diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js index 84f8ad631..caef313af 100644 --- a/js/ui/shellMountOperation.js +++ b/js/ui/shellMountOperation.js @@ -74,6 +74,10 @@ export class ShellMountOperation { this.close.bind(this)); this.mountOp.connect('show-unmount-progress', this._onShowUnmountProgress.bind(this)); + + this._drive = source.get_drive(); + this._drive?.connectObject('disconnected', + this.close.bind(this), this); } _closeExistingDialog() { @@ -141,6 +145,11 @@ export class ShellMountOperation { this._notifier.done(); this._notifier = null; } + + if (this._drive) { + this._drive.disconnectObject(this); + this._drive = null; + } } _onShowProcesses2(op) {