mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-15 04:05:11 +01:00
GMenuModel exporter: remove workaround
With Bug 665733 fixed, we can remove the workaround (which was causing thread safety problems).
This commit is contained in:
parent
328bf4616a
commit
21aca44ee1
@ -770,12 +770,11 @@ g_menu_exporter_create_group (GMenuExporter *exporter)
|
|||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static GMenuExporter *g_menu_exporter_to_free;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_menu_exporter_actually_free (GMenuExporter *exporter)
|
g_menu_exporter_free (gpointer user_data)
|
||||||
{
|
{
|
||||||
|
GMenuExporter *exporter = user_data;
|
||||||
|
|
||||||
g_menu_exporter_menu_free (exporter->root);
|
g_menu_exporter_menu_free (exporter->root);
|
||||||
g_hash_table_unref (exporter->remotes);
|
g_hash_table_unref (exporter->remotes);
|
||||||
g_hash_table_unref (exporter->groups);
|
g_hash_table_unref (exporter->groups);
|
||||||
@ -785,20 +784,6 @@ g_menu_exporter_actually_free (GMenuExporter *exporter)
|
|||||||
g_slice_free (GMenuExporter, exporter);
|
g_slice_free (GMenuExporter, exporter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
g_menu_exporter_free (gpointer user_data)
|
|
||||||
{
|
|
||||||
/* XXX: hack
|
|
||||||
*
|
|
||||||
* GDBusConnection calls the destroy notify while holding its own lock
|
|
||||||
* which means that we get a deadlock on re-entering it.
|
|
||||||
*
|
|
||||||
* Work around this for now...
|
|
||||||
*/
|
|
||||||
g_assert (g_menu_exporter_to_free == NULL);
|
|
||||||
g_menu_exporter_to_free = user_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_menu_exporter_method_call (GDBusConnection *connection,
|
g_menu_exporter_method_call (GDBusConnection *connection,
|
||||||
const gchar *sender,
|
const gchar *sender,
|
||||||
@ -903,12 +888,7 @@ void
|
|||||||
g_dbus_connection_unexport_menu_model (GDBusConnection *connection,
|
g_dbus_connection_unexport_menu_model (GDBusConnection *connection,
|
||||||
guint export_id)
|
guint export_id)
|
||||||
{
|
{
|
||||||
if (!g_dbus_connection_unregister_object (connection, export_id))
|
g_dbus_connection_unregister_object (connection, export_id);
|
||||||
return;
|
|
||||||
|
|
||||||
g_assert (g_menu_exporter_to_free != NULL);
|
|
||||||
g_menu_exporter_actually_free (g_menu_exporter_to_free);
|
|
||||||
g_menu_exporter_to_free = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* {{{1 Epilogue */
|
/* {{{1 Epilogue */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user