summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/manual/memory/RemoveChild-2170.html
diff options
context:
space:
mode:
Diffstat (limited to 'misc/openlayers/tests/manual/memory/RemoveChild-2170.html')
-rw-r--r--misc/openlayers/tests/manual/memory/RemoveChild-2170.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/misc/openlayers/tests/manual/memory/RemoveChild-2170.html b/misc/openlayers/tests/manual/memory/RemoveChild-2170.html
new file mode 100644
index 0000000..abe9249
--- /dev/null
+++ b/misc/openlayers/tests/manual/memory/RemoveChild-2170.html
@@ -0,0 +1,56 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Memory Test - DOMNode.removeChild</title>
+ <style type="text/css">
+ body {
+ font-size: 0.8em;
+ }
+ p {
+ padding-top: 1em;
+ }
+ #map {
+ width: 512px;
+ height: 512px;
+ border: 1px solid black;
+ }
+ </style>
+
+ <script src="../../../lib/Firebug/firebug.js"></script>
+ <script src="../../../lib/OpenLayers.js"></script>
+ <script type="text/javascript">
+ var map, layer;
+
+ function tearDown() {
+ layer.events.unregister("loadend", layer, tearDown);
+ window.setTimeout(function() {
+ map.removeLayer(layer);
+ //map.addLayer(layer);
+ layer.destroy();
+ window.alert("Setup - hit STOP in the leak detector now");
+ }, 100);
+ }
+
+ function init(){
+ map = new OpenLayers.Map( 'map', {maxResolution:1.40625/2} );
+ layer = new OpenLayers.Layer.TMS( "TMS",
+ "http://labs.metacarta.com/wms-c/Basic.py/", {layername: 'basic', type:'png'} );
+ map.addLayer(layer);
+ map.setCenter(new OpenLayers.LonLat(5, 40), 5);
+
+ layer.events.register("loadend", layer, tearDown);
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <h1 id="title">Memory Test - DOMNode.removeChild</h1>
+ <pre id="status"></pre>
+ <div id="map"></div>
+ <p>
+ This test is a memory leak test for usage of DOMNode.removeChild
+ </p>
+ <p>
+ Run this test in IE6/7 with <a href="http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector-v2.aspx">JavaScript Memory Leak Detector v2</a>
+ and watch it identify a leak unless this is fixed.
+ </p>
+ </body>
+</html>