Skip to content

Commit

Permalink
Merge branch 'thread-safe-menus_get_interface' into 'main'
Browse files Browse the repository at this point in the history
gmenuexporter: synchronization in org_gtk_Menus_get_interface.

Closes #3051

See merge request GNOME/glib!3529
  • Loading branch information
pwithnall committed Aug 13, 2023
2 parents 3ee019c + 5fb89dd commit 73d2658
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gio/gmenuexporter.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ static GDBusInterfaceInfo *
org_gtk_Menus_get_interface (void)
{
static GDBusInterfaceInfo *interface_info;
static gsize interface_info_initialized = 0;

if (interface_info == NULL)
if (g_once_init_enter (&interface_info_initialized))
{
GError *error = NULL;
GDBusNodeInfo *info;
Expand All @@ -79,6 +80,8 @@ org_gtk_Menus_get_interface (void)
g_assert (interface_info != NULL);
g_dbus_interface_info_ref (interface_info);
g_dbus_node_info_unref (info);

g_once_init_leave (&interface_info_initialized, 1);
}

return interface_info;
Expand Down

0 comments on commit 73d2658

Please sign in to comment.