OpenLayers OpenLayers

Changeset 6230

Show
Ignore:
Timestamp:
02/12/08 11:43:47 (1 year ago)
Author:
tschaub
Message:

Only destroy events if they are not already destroyed. This is relevant for controls with obligate controls. Since the map thinks it is in charge of destroying controls, and parent controls also destroy obligate controls, control.destroy ends up getting called twice. If someone wants to change the way this is handled, we should have a standard property that lets the map know that control.destroy is the responsibility of someone else. r=crschmidt (closes #1346)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Control.js

    r6172 r6230  
    166166     */ 
    167167    destroy: function () { 
    168         this.events.destroy(); 
    169         this.events = null; 
     168        if(this.events) { 
     169            this.events.destroy(); 
     170            this.events = null; 
     171        } 
    170172        // eliminate circular references 
    171173        if (this.handler) {