Drop unused patch
Raphaël Hertzog
6 years ago
0 | From 61594afd687bf5883cc39fa79c5fbdb0d4cc9eda Mon Sep 17 00:00:00 2001 | |
1 | From: Florian Müllner <[email protected]> | |
2 | Date: Wed, 17 Jan 2018 21:57:49 +0100 | |
3 | Subject: [PATCH] places-menu: Don't force dispose() of uninitialized proxies | |
4 | ||
5 | Trying to dispose a proxy object before it has been properly | |
6 | initialized triggers an "uncatchable exception", which gjs | |
7 | treats as a fatal error since commit c7bdcaab4. We only have | |
8 | anything to clean up once the proxy is initialized anyway, so | |
9 | don't force dispose() before that. | |
10 | ||
11 | https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/44 | |
12 | https://gitlab.gnome.org/GNOME/gjs/issues/33 | |
13 | --- | |
14 | extensions/places-menu/placeDisplay.js | 28 ++++++++++++++++------------ | |
15 | 1 file changed, 16 insertions(+), 12 deletions(-) | |
16 | ||
17 | diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js | |
18 | index ba316bf..9647d63 100644 | |
19 | --- a/extensions/places-menu/placeDisplay.js | |
20 | +++ b/extensions/places-menu/placeDisplay.js | |
21 | @@ -136,17 +136,18 @@ const RootInfo = new Lang.Class({ | |
22 | _init: function() { | |
23 | this.parent('devices', Gio.File.new_for_path('/'), _("Computer")); | |
24 | ||
25 | - this._proxy = new Hostname1(Gio.DBus.system, | |
26 | - 'org.freedesktop.hostname1', | |
27 | - '/org/freedesktop/hostname1', | |
28 | - Lang.bind(this, function(obj, error) { | |
29 | - if (error) | |
30 | - return; | |
31 | - | |
32 | - this._proxy.connect('g-properties-changed', | |
33 | - Lang.bind(this, this._propertiesChanged)); | |
34 | - this._propertiesChanged(obj); | |
35 | - })); | |
36 | + new Hostname1(Gio.DBus.system, | |
37 | + 'org.freedesktop.hostname1', | |
38 | + '/org/freedesktop/hostname1', | |
39 | + Lang.bind(this, function(obj, error) { | |
40 | + if (error) | |
41 | + return; | |
42 | + | |
43 | + this._proxy = obj; | |
44 | + this._proxy.connect('g-properties-changed', | |
45 | + Lang.bind(this, this._propertiesChanged)); | |
46 | + this._propertiesChanged(obj); | |
47 | + })); | |
48 | }, | |
49 | ||
50 | getIcon: function() { | |
51 | @@ -163,7 +164,10 @@ const RootInfo = new Lang.Class({ | |
52 | }, | |
53 | ||
54 | destroy: function() { | |
55 | - this._proxy.run_dispose(); | |
56 | + if (this._proxy) { | |
57 | + this._proxy.run_dispose(); | |
58 | + this._proxy = null; | |
59 | + } | |
60 | this.parent(); | |
61 | } | |
62 | }); | |
63 | -- | |
64 | libgit2 0.26.0 | |
65 |