Skip to content

Commit 541d173

Browse files
authored
Merge pull request #1 from MehmetNuri/develop
fix: disconnect popup destroy signal in disable() (EGO-L-003)
2 parents 026f005 + e1cd5ff commit 541d173

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

extension.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ class AudioOutputSwitcherExtension {
261261
this._manager = null;
262262
this._keybindingAction = null;
263263
this._popup = null;
264+
this._popupDestroyId = 0;
264265
}
265266

266267
enable() {
@@ -278,6 +279,10 @@ class AudioOutputSwitcherExtension {
278279
this._removeKeybinding();
279280

280281
if (this._popup) {
282+
if (this._popupDestroyId) {
283+
this._popup.disconnect(this._popupDestroyId);
284+
this._popupDestroyId = 0;
285+
}
281286
this._popup.destroy();
282287
this._popup = null;
283288
}
@@ -332,9 +337,11 @@ class AudioOutputSwitcherExtension {
332337

333338
const popup = new OutputSwitcherPopup(outputs, this._keybindingAction, this._manager);
334339
this._popup = popup;
335-
popup.connect('destroy', () => {
336-
if (this._popup === popup)
340+
this._popupDestroyId = popup.connect('destroy', () => {
341+
if (this._popup === popup) {
337342
this._popup = null;
343+
this._popupDestroyId = 0;
344+
}
338345
});
339346

340347
const shown = popup.show(

0 commit comments

Comments
 (0)