#629 - remove events from geometry
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2997 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -27,9 +27,6 @@ OpenLayers.Geometry.prototype = {
|
|||||||
*
|
*
|
||||||
* @type OpenLayers.Feature */
|
* @type OpenLayers.Feature */
|
||||||
feature: null,
|
feature: null,
|
||||||
|
|
||||||
/** @type OpenLayers.Events */
|
|
||||||
events:null,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -47,10 +44,6 @@ OpenLayers.Geometry.prototype = {
|
|||||||
this.bounds = null;
|
this.bounds = null;
|
||||||
this.feature = null;
|
this.feature = null;
|
||||||
|
|
||||||
if (this.events) {
|
|
||||||
this.events.destroy();
|
|
||||||
}
|
|
||||||
this.events = null;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -178,19 +178,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_99_Geometry_destroy(t) {
|
function test_99_Geometry_destroy(t) {
|
||||||
t.plan( 5 );
|
t.plan( 3 );
|
||||||
|
|
||||||
var g = new OpenLayers.Geometry();
|
var g = new OpenLayers.Geometry();
|
||||||
g.bounds = new OpenLayers.Bounds();
|
g.bounds = new OpenLayers.Bounds();
|
||||||
g.feature = new Object();
|
g.feature = new Object();
|
||||||
g.events = {
|
|
||||||
'destroy': function() {
|
|
||||||
g_events_destroy = {};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
g_style_destroy = null;
|
g_style_destroy = null;
|
||||||
g_events_destroy = {};
|
|
||||||
g.destroy();
|
g.destroy();
|
||||||
|
|
||||||
t.eq(g.id, null, "id nullified");
|
t.eq(g.id, null, "id nullified");
|
||||||
@@ -198,8 +192,6 @@
|
|||||||
t.eq(g.bounds, null, "bounds nullified");
|
t.eq(g.bounds, null, "bounds nullified");
|
||||||
t.eq(g.feature, null, "feature reference nullified");
|
t.eq(g.feature, null, "feature reference nullified");
|
||||||
|
|
||||||
t.ok(g_events_destroy != null, "events.destroy() called on non-null events");
|
|
||||||
t.eq(g.events, null, "events nullified");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user