mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
GApplication: Don't call dbus_unregister multiple times
https://bugzilla.gnome.org/show_bug.cgi?id=725950
This commit is contained in:
parent
b92e15c75d
commit
df06dc6550
@ -120,6 +120,7 @@ struct _GApplicationImpl
|
|||||||
gboolean properties_live;
|
gboolean properties_live;
|
||||||
gboolean primary;
|
gboolean primary;
|
||||||
gboolean busy;
|
gboolean busy;
|
||||||
|
gboolean registered;
|
||||||
GApplication *app;
|
GApplication *app;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -403,6 +404,7 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
|
|||||||
if (impl->actions_id == 0)
|
if (impl->actions_id == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
impl->registered = TRUE;
|
||||||
if (!app_class->dbus_register (impl->app,
|
if (!app_class->dbus_register (impl->app,
|
||||||
impl->session_bus,
|
impl->session_bus,
|
||||||
impl->object_path,
|
impl->object_path,
|
||||||
@ -455,9 +457,13 @@ g_application_impl_stop_primary (GApplicationImpl *impl)
|
|||||||
{
|
{
|
||||||
GApplicationClass *app_class = G_APPLICATION_GET_CLASS (impl->app);
|
GApplicationClass *app_class = G_APPLICATION_GET_CLASS (impl->app);
|
||||||
|
|
||||||
app_class->dbus_unregister (impl->app,
|
if (impl->registered)
|
||||||
impl->session_bus,
|
{
|
||||||
impl->object_path);
|
app_class->dbus_unregister (impl->app,
|
||||||
|
impl->session_bus,
|
||||||
|
impl->object_path);
|
||||||
|
impl->registered = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (impl->object_id)
|
if (impl->object_id)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user