summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-09-05 23:24:35 +0000
committerMatthias Clasen <mclasen@redhat.com>2018-09-05 23:24:35 +0000
commit6d5279f3c8cd47eb8d3bbc1fc121bd72ac6d4acf (patch)
tree16173378a38f565532de7bf099154c64aecc7b50
parent207e93f09ca2a272ea795f86f8285319df745f6d (diff)
parent3c7d5e749ccafa75718ef00f1d5f6cdc0defacb3 (diff)
downloadgtk+-6d5279f3c8cd47eb8d3bbc1fc121bd72ac6d4acf.tar.gz
Merge branch 'gtk-3-24' into 'gtk-3-24'
GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE See merge request GNOME/gtk!320
-rw-r--r--gtk/gtkapplication-dbus.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/gtk/gtkapplication-dbus.c b/gtk/gtkapplication-dbus.c
index 25015eb68c..0946edf35c 100644
--- a/gtk/gtkapplication-dbus.c
+++ b/gtk/gtkapplication-dbus.c
@@ -826,15 +826,22 @@ gtk_application_impl_dbus_finalize (GObject *object)
{
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) object;
- g_dbus_connection_call (dbus->session,
- "org.freedesktop.portal.Desktop",
- dbus->session_id,
- "org.freedesktop.portal.Session",
- "Close",
- NULL, NULL, 0, -1, NULL, NULL, NULL);
-
- g_free (dbus->session_id);
- g_dbus_connection_signal_unsubscribe (dbus->session, dbus->state_changed_handler);
+ if (dbus->session_id)
+ {
+ g_dbus_connection_call (dbus->session,
+ "org.freedesktop.portal.Desktop",
+ dbus->session_id,
+ "org.freedesktop.portal.Session",
+ "Close",
+ NULL, NULL, 0, -1, NULL, NULL, NULL);
+
+ g_free (dbus->session_id);
+ }
+
+ if (dbus->state_changed_handler)
+ g_dbus_connection_signal_unsubscribe (dbus->session,
+ dbus->state_changed_handler);
+
g_clear_object (&dbus->inhibit_proxy);
g_slist_free_full (dbus->inhibit_handles, inhibit_handle_free);
g_free (dbus->app_menu_path);