diff options
| author | Michael Biebl <biebl@debian.org> | 2012-03-24 01:37:02 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2012-03-24 01:37:02 +0100 |
| commit | de06e5715e780baade318f3490ac7a4c9ce84e32 (patch) | |
| tree | 23fbc3fafc12072476eff98bee60100eb54c29db /libnm-glib/nm-object-cache.c | |
| parent | b436a68a20ff3114ded32a7a3d70cdd4954039f9 (diff) | |
Imported Upstream version 0.9.4.0 upstream/0.9.4.0
Diffstat (limited to 'libnm-glib/nm-object-cache.c')
| -rw-r--r-- | libnm-glib/nm-object-cache.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libnm-glib/nm-object-cache.c b/libnm-glib/nm-object-cache.c index c43b4273..741f1291 100644 --- a/libnm-glib/nm-object-cache.c +++ b/libnm-glib/nm-object-cache.c @@ -34,18 +34,12 @@ _init_cache (void) cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } -void -_nm_object_cache_remove_by_path (const char *path) +static void +_nm_object_cache_remove_by_path (char *path) { _init_cache (); g_hash_table_remove (cache, path); -} - -void -_nm_object_cache_remove_by_object (NMObject *object) -{ - _init_cache (); - g_hash_table_remove (cache, nm_object_get_path (object)); + g_free (path); } void @@ -57,7 +51,7 @@ _nm_object_cache_add (NMObject *object) path = g_strdup (nm_object_get_path (object)); g_hash_table_insert (cache, path, object); g_object_set_data_full (G_OBJECT (object), "nm-object-cache-tag", - path, (GDestroyNotify) _nm_object_cache_remove_by_path); + g_strdup (path), (GDestroyNotify) _nm_object_cache_remove_by_path); } NMObject * |