Skip to content

Commit 3ff6308

Browse files
authored
Fixed bug which causes this._panelZoneSizes is null error when toggling panel edit mode when these applets were removed from a panel and that panel was removed. (#13034)
Applets were still listening for panel-edit-mode changed signal and not garbage collected.
1 parent 13c5d39 commit 3ff6308

File tree

2 files changed

+4
-2
lines changed
  • files/usr/share/cinnamon/applets

2 files changed

+4
-2
lines changed

files/usr/share/cinnamon/applets/notifications@cinnamon.org/applet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
3838

3939
// Events
4040
Main.messageTray.connect('notify-applet-update', Lang.bind(this, this._notification_added));
41-
global.settings.connect('changed::' + PANEL_EDIT_MODE_KEY, Lang.bind(this, this._on_panel_edit_mode_changed));
41+
this.panelEditModeHandler = global.settings.connect('changed::' + PANEL_EDIT_MODE_KEY, Lang.bind(this, this._on_panel_edit_mode_changed));
4242

4343
// States
4444
this._blinking = false;
@@ -53,6 +53,7 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
5353
on_applet_removed_from_panel () {
5454
Main.keybindingManager.removeHotKey("notification-open-" + this.instance_id);
5555
Main.keybindingManager.removeHotKey("notification-clear-" + this.instance_id);
56+
global.settings.disconnect(this.panelEditModeHandler);
5657
}
5758

5859
_openMenu() {

files/usr/share/cinnamon/applets/printers@cinnamon.org/applet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CinnamonPrintersApplet extends Applet.TextIconApplet {
3030
this.settings = new Settings.AppletSettings(this, metadata.uuid, instance_id);
3131
this.settings.bind('show-icon', 'show_icon', this.update);
3232

33-
global.settings.connect('changed::' + PANEL_EDIT_MODE_KEY, Lang.bind(this, this._on_panel_edit_mode_changed));
33+
this.panelEditModeHandler = global.settings.connect('changed::' + PANEL_EDIT_MODE_KEY, Lang.bind(this, this._on_panel_edit_mode_changed));
3434

3535
this.jobsCount = 0;
3636
this.printersCount = 0;
@@ -56,6 +56,7 @@ class CinnamonPrintersApplet extends Applet.TextIconApplet {
5656

5757
on_applet_removed_from_panel() {
5858
this.settings.finalize();
59+
global.settings.disconnect(this.panelEditModeHandler);
5960
}
6061

6162
_on_panel_edit_mode_changed () {

0 commit comments

Comments
 (0)