From de06e5715e780baade318f3490ac7a4c9ce84e32 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 24 Mar 2012 01:37:02 +0100 Subject: Imported Upstream version 0.9.4.0 --- libnm-glib/nm-object-cache.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libnm-glib/nm-object-cache.c') 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 * -- cgit 1.3.0-6-gf8a5