OpenLayers OpenLayers

Ticket #1346: destroy_once.patch

File destroy_once.patch, 0.6 kB (added by crschmidt, 1 year ago)
  • lib/OpenLayers/Control.js

    old new  
    165165     * to prevent memory leaks. 
    166166     */ 
    167167    destroy: function () { 
     168        // Only destroy once. 
     169        if (this.events == null) { 
     170            return; 
     171        }     
    168172        this.events.destroy(); 
    169173        this.events = null; 
     174         
    170175        // eliminate circular references 
    171176        if (this.handler) { 
    172177            this.handler.destroy();