[gnome-documents/rhel-7.4: 13/16] application: Avoid CRITICALs if a primary instance is already present



commit 238a4d4c95b78eff9d1a764f184936ddc58db73d
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]