Commit 5c222582 authored by Ray Strode's avatar Ray Strode

lib: make sure replace key when replacing value in object_path hash

If add_user gets called on user object that's already being tracked
by object path, we can end up replacing and freeing the user object
but leaving the old object path memory in the hash table.

This commit makes sure we replace the key when replacing the object.
parent 7ef30275
......@@ -869,9 +869,9 @@ add_user (ActUserManager *manager,
object_path = act_user_get_object_path (user);
if (object_path != NULL) {
g_hash_table_insert (manager->priv->users_by_object_path,
(gpointer) object_path,
g_object_ref (user));
g_hash_table_replace (manager->priv->users_by_object_path,
(gpointer) object_path,
g_object_ref (user));
}
g_signal_connect_object (user,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment