From 68041cd647ef64c698462961e5685612ca70dd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 28 Feb 2023 05:00:51 +0100 Subject: [PATCH] locations: Create launchMaxWait in order Even though that's only used in a delayed promise, it's still better to go in order. --- locations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locations.js b/locations.js index c7e524d42..5477dd5b2 100644 --- a/locations.js +++ b/locations.js @@ -348,6 +348,9 @@ var LocationAppInfo = GObject.registerClass({ getHandlerApp(cancellable) { cancellable = cancellable ?? new Utils.CancellableChild(this.cancellable); + if (this._launchMaxWaitIds === undefined) + this._launchMaxWaitIds = new Set(); + // GVfs providers could hang when querying the file informations, so we // workaround this by using the async API in a sync way, but we need to // use a timeout to avoid this to hang forever, better than hang the @@ -370,9 +373,6 @@ var LocationAppInfo = GObject.registerClass({ }), ]).then(h => (handler = h)).catch(e => (error = e)); - if (this._launchMaxWaitIds === undefined) - this._launchMaxWaitIds = new Set(); - while (handler === undefined && error === undefined) GLib.MainContext.default().iteration(false);