Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRU fix for LP: 1769383 #848

Merged
merged 2 commits into from Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion debian/changelog
@@ -1,9 +1,13 @@
gnome-shell-extension-ubuntu-dock (63ubuntu1.18.10.1) UNRELEASED; urgency=medium

[ Marco Trevisan (Treviño) ]
* debian/control, debian/gbp.conf:
- update branch references

-- Marco Trevisan (Treviño) <marco@ubuntu.com> Thu, 22 Nov 2018 15:35:25 -0600
[ Andrea Azzarone ]
* extension: Ensure signal disconnection (LP: #1769383)

-- Andrea <andrea@ubuntu> Fri, 30 Nov 2018 11:49:18 +0000

gnome-shell-extension-ubuntu-dock (63ubuntu1) cosmic; urgency=medium

Expand Down
20 changes: 12 additions & 8 deletions extension.js
Expand Up @@ -21,20 +21,24 @@ function enable() {
* Listen to enabled extension, if Dash to Dock is on the list or become active,
* we disable this dock.
*/
dockManager=null; // even if declared, we need to initialize it to not trigger a referenceError.
_extensionlistenerId = ExtensionSystem.connect('extension-state-changed',
conditionallyenabledock);
conditionallyenabledock();
}

function disable() {
dockManager.destroy();

dockManager=null;

if (_extensionlistenerId) {
ExtensionSystem.disconnect(_extensionlistenerId);
_extensionlistenerId = 0;
try {
if (dockManager != null) {
dockManager.destroy();
dockManager = null;
}
} catch(e) {
log('Failed to destroy dockManager: %s'.format(e.message));
} finally {
if (_extensionlistenerId) {
ExtensionSystem.disconnect(_extensionlistenerId);
_extensionlistenerId = 0;
}
}
}

Expand Down