From 87bad5b9f8bf284bfe2fb7992621707ae4b173a4 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Fri, 6 Apr 2007 03:30:31 +0000 Subject: [PATCH] #633: Fix memory leak in box marker used for boxes layer. Add comprehensive tests for Box marker. git-svn-id: http://svn.openlayers.org/trunk/openlayers@3026 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Marker/Box.js | 11 ++ tests/Marker/test_Box.html | 362 +++++++++++++++++++++++++++++++++++ tests/list-tests.html | 1 + 3 files changed, 374 insertions(+) create mode 100644 tests/Marker/test_Box.html diff --git a/lib/OpenLayers/Marker/Box.js b/lib/OpenLayers/Marker/Box.js index 412c875cbd..8501439560 100644 --- a/lib/OpenLayers/Marker/Box.js +++ b/lib/OpenLayers/Marker/Box.js @@ -33,6 +33,17 @@ OpenLayers.Marker.Box.prototype = this.setBorder(borderColor, borderWidth); }, + /** + * + */ + destroy: function() { + + this.bounds = null; + this.div = null; + + OpenLayers.Marker.prototype.destroy.apply(this, arguments); + }, + /** Allow the user to change the box's color and border width * * @param {String} color Default is "red" diff --git a/tests/Marker/test_Box.html b/tests/Marker/test_Box.html new file mode 100644 index 0000000000..066cf4197e --- /dev/null +++ b/tests/Marker/test_Box.html @@ -0,0 +1,362 @@ + + + + + + +
+ + + + + + + + +
+ + diff --git a/tests/list-tests.html b/tests/list-tests.html index 3f8bb3fc58..5ef330d379 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -20,6 +20,7 @@
  • Format/test_WKT.html
  • test_Icon.html
  • test_Marker.html
  • +
  • Marker/test_Box.html
  • test_Popup.html
  • test_Feature.html
  • Feature/test_Vector.html