diff options
-rw-r--r-- | libnm-glib/nm-object-cache.c | 14 | ||||
-rw-r--r-- | libnm-glib/nm-object-cache.h | 2 |
2 files changed, 4 insertions, 12 deletions
diff --git a/libnm-glib/nm-object-cache.c b/libnm-glib/nm-object-cache.c index c43b427335..741f1291bd 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 * diff --git a/libnm-glib/nm-object-cache.h b/libnm-glib/nm-object-cache.h index 2348dcfa09..8386591cd8 100644 --- a/libnm-glib/nm-object-cache.h +++ b/libnm-glib/nm-object-cache.h @@ -32,8 +32,6 @@ G_BEGIN_DECLS /* Returns referenced object from the cache */ NMObject *_nm_object_cache_get (const char *path); void _nm_object_cache_add (NMObject *object); -void _nm_object_cache_remove_by_object (NMObject *object); -void _nm_object_cache_remove_by_path (const char *path); G_END_DECLS |