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



commit ad052dd89f883676b2ec9b72423c5f4eff78df15
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 f14758b..27c256a 100644
--- a/src/application.js
+++ b/src/application.js
@@ -449,7 +449,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]