[OpenLayers-Trac] Re: [OpenLayers] #2697: Handler.Box: destroy drag handler

OpenLayers trac-20090302 at openlayers.org
Thu Oct 28 15:39:14 EDT 2010


#2697: Handler.Box: destroy drag handler
------------------------------+---------------------------------------------
  Reporter:  fredj            |       Owner:              
      Type:  bug              |      Status:  reopened    
  Priority:  trivial          |   Milestone:  2.10 Release
 Component:  Handler.Box      |     Version:  SVN         
Resolution:                   |    Keywords:              
     State:  Needs More Work  |  
------------------------------+---------------------------------------------
Changes (by jcachat):

  * status:  closed => reopened
  * state:  Complete => Needs More Work
  * resolution:  fixed =>


Comment:

 There is a problem with this patch.  dragHandler is destroyed and nulled
 out before calling the base destroy method.  If you step through
 OpenLayers.Handler.prototype.destroy it will eventually call back into
 Box.deactivate() if the handler was active at the time it was being
 destroyed.  This causes a null exception in Box.deactivate() when it tries
 to call this.dragHandler.deactivate().

 The solution I found was to change Box.destroy() to first call
 OpenLayers.Handler.prototype.destroy then take care of destroying the
 dragHandler.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2697#comment:6>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list