Skip to content

Commit

Permalink
GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
heftig authored and db-src committed Sep 22, 2018
1 parent 19bf502 commit d90e273
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions gtk/gtkapplication-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,22 @@ gtk_application_impl_dbus_finalize (GObject *object)
{
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) object;

g_dbus_connection_call (dbus->session,
PORTAL_BUS_NAME,
dbus->session_id,
PORTAL_SESSION_INTERFACE,
"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,
PORTAL_BUS_NAME,
dbus->session_id,
PORTAL_SESSION_INTERFACE,
"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);
Expand Down

0 comments on commit d90e273

Please sign in to comment.