mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
gdesktopappinfo: Asynchronously flush after sending notification
If we were the initial connection owner, unref will destroy the connection immediately, and we may lose messages. Asynchronously flush to avoid that. https://bugzilla.gnome.org/show_bug.cgi?id=641411
This commit is contained in:
parent
626f197ee3
commit
d6954c785d
@ -1096,7 +1096,14 @@ _g_desktop_app_info_launch_uris_internal (GAppInfo *appinfo,
|
|||||||
* after launching an app. See http://bugzilla.gnome.org/606960
|
* after launching an app. See http://bugzilla.gnome.org/606960
|
||||||
*/
|
*/
|
||||||
if (session_bus != NULL)
|
if (session_bus != NULL)
|
||||||
|
{
|
||||||
|
/* This asynchronous flush holds a reference until it completes,
|
||||||
|
* which ensures that the following unref won't immediately kill
|
||||||
|
* the connection if we were the initial owner.
|
||||||
|
*/
|
||||||
|
g_dbus_connection_flush (session_bus, NULL, NULL, NULL);
|
||||||
g_object_unref (session_bus);
|
g_object_unref (session_bus);
|
||||||
|
}
|
||||||
|
|
||||||
completed = TRUE;
|
completed = TRUE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user