diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index 8a0748d2c..5007f98b0 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -2645,7 +2645,10 @@ initable_init (GInitable *initable, G_LOCK (message_bus_lock); if (alive_connections == NULL) - alive_connections = g_hash_table_new (g_direct_hash, g_direct_equal); + { + alive_connections = g_hash_table_new (g_direct_hash, g_direct_equal); + G_CLEANUP_IN (alive_connections, g_hash_table_unref, G_CLEANUP_PHASE_LATE); + } g_hash_table_insert (alive_connections, connection, connection); G_UNLOCK (message_bus_lock); diff --git a/gio/gdbuserror.c b/gio/gdbuserror.c index 685d85382..cc4e8420c 100644 --- a/gio/gdbuserror.c +++ b/gio/gdbuserror.c @@ -368,10 +368,13 @@ g_dbus_error_register_error (GQuark error_domain, g_assert (dbus_error_name_to_re == NULL); /* check invariant */ quark_code_pair_to_re = g_hash_table_new ((GHashFunc) quark_code_pair_hash_func, (GEqualFunc) quark_code_pair_equal_func); + G_CLEANUP_IN (quark_code_pair_to_re, g_hash_table_unref, G_CLEANUP_PHASE_LATE); + dbus_error_name_to_re = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) registered_error_free); + G_CLEANUP_IN (dbus_error_name_to_re, g_hash_table_unref, G_CLEANUP_PHASE_LATE); } if (g_hash_table_lookup (dbus_error_name_to_re, dbus_error_name) != NULL)