[gnome-documents/gnome-3-22] application: Avoid CRITICALs if a primary instance is already present



commit 8aad34046faf1a52d2d4319f4defe388c48b80b0
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 8 16:10:57 2017 +0200

    application: Avoid CRITICALs if a primary instance is already present
    
    The dbus_unregister method can be invoked more than once. Trying to
    unexport an already unexported GDBusInterfaceSkeleton led to:
      GLib-GIO-CRITICAL **:
        g_dbus_interface_skeleton_unexport_from_connection: assertion
        'interface_->priv->connections != NULL' failed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783548

 src/application.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index a82395d..40a5dd0 100644
--- a/src/application.js
+++ b/src/application.js
@@ -521,7 +521,10 @@ const Application = new Lang.Class({
     },
 
     vfunc_dbus_unregister: function(connection, path) {
-        this._searchProvider.unexport(connection);
+        if (this._searchProvider != null) {
+            this._searchProvider.unexport(connection);
+            this._searchProvider = null;
+        }
 
         this.parent(connection, path);
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]