diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 125024204..63ce5a020 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -367,6 +367,10 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { y = stageY - this._dragActor.height / 2; } this._dragActor.set_position(x, y); + + this._dragActorSourceDestroyId = this._dragActorSource.connect('destroy', () => { + this._dragActorSource = null; + }); } else { this._dragActorSource = this.actor; } @@ -799,6 +803,11 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { this._dragOrigParent = null; } + if (this._dragActorSource) { + this._dragActorSource.disconnect(this._dragActorSourceDestroyId); + this._dragActorSource = null; + } + this._dragState = DragState.INIT; currentDraggable = null; }