fix leak
authorHannes Janetzek <hannes.janetzek@gmail.com>
Thu, 29 Apr 2010 16:34:11 +0000 (16:34 +0000)
committerHannes Janetzek <hannes.janetzek@gmail.com>
Thu, 29 Apr 2010 16:34:11 +0000 (16:34 +0000)
SVN revision: 48422

src/modules/everything/evry.c
src/modules/everything/evry_plug_actions.c
src/modules/everything/evry_plug_aggregator.c

index 95e7b95..6945284 100644 (file)
@@ -300,7 +300,7 @@ evry_clear_input(Evry_Plugin *p)
    _evry_update_text_label(s);
 }
 
-//#define CHECK_REFS 1
+//#define CHECK_REFS
 
 #ifdef CHECK_REFS
 static int item_cnt = 0;
@@ -335,6 +335,7 @@ evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label,
 
 #ifdef CHECK_REFS
    item_cnt++;
+   printf("%d, %d\t new : %s\n", it->ref, item_cnt, it->label);
 #endif
 
    return it;
index 4374bec..7041dda 100644 (file)
@@ -176,12 +176,13 @@ int evry_plug_actions_init()
 
 void evry_plug_actions_shutdown()
 {
-   Evry_Action *a;
+   Evry_Item *it;
 
    evry_plugin_free(_base_plug);
 
-   EINA_LIST_FREE(evry_conf->actions, a)
-     evry_action_free(a);
+   /* bypass unregister, because it modifies the list */
+   EINA_LIST_FREE(evry_conf->actions, it)
+     evry_item_free(it);
 }
 
 
index 750d619..36d56a4 100644 (file)
@@ -264,12 +264,23 @@ _finish(Evry_Plugin *plugin)
      evry_item_free(it);
 }
 
+
+static void
+_free(Evry_Plugin *plugin)
+{
+   GET_PLUGIN(p, plugin);
+   
+   _finish(plugin);
+
+   free(p);
+}
+
 Evry_Plugin *
 evry_plug_aggregator_new(Evry_Selector *sel, int type)
 {
    Evry_Plugin *p;
 
-   p = EVRY_PLUGIN_NEW(Plugin, N_("All"), NULL, 0, NULL, _finish, _fetch, NULL);
+   p = EVRY_PLUGIN_NEW(Plugin, N_("All"), NULL, 0, NULL, _finish, _fetch, _free);
 
    p->history = EINA_FALSE;
    evry_plugin_register(p, type, -1);