From c3bd07e8e6679bbda00737b81b2397b93ec5a723 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 10:54:50 -0600 Subject: Copying the name before using it to remove as it seems that the unwatch can cause the name to be free'd in some cases. Odd, but valgrind can find it --- libindicator/indicator-service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index e9f3133..11171fc 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -588,7 +588,9 @@ unwatch_core (IndicatorService * service, const gchar * name) /* Remove us from the watcher list here */ gpointer watcher_item = g_hash_table_lookup(priv->watchers, name); if (watcher_item != NULL) { - g_hash_table_remove(priv->watchers, name); + gchar * safe_name = g_strdup(name); + g_hash_table_remove(priv->watchers, safe_name); + g_free(safe_name); } else { /* Odd that we couldn't find the person, but, eh */ g_warning("Unable to find watcher who is unwatching: %s", name); -- cgit v1.2.3 -- cgit v1.2.3