fix memory leak generated by setIcon

when setIcon is called this.dragging is replaced without be disabled before, so hooks remains active.
This commit is contained in:
jfgodoy 2014-07-24 00:44:42 -04:00
parent 112ac5b4b6
commit aeea88b9fc

View File

@ -209,6 +209,10 @@ L.Marker = L.Layer.extend({
this._fireMouseEvent, this);
if (L.Handler.MarkerDrag) {
if (this.dragging) {
this.dragging.disable();
}
this.dragging = new L.Handler.MarkerDrag(this);
if (this.options.draggable) {