'everything' fix leaks
authorHannes Janetzek <hannes.janetzek@gmail.com>
Sun, 11 Apr 2010 13:40:10 +0000 (13:40 +0000)
committerHannes Janetzek <hannes.janetzek@gmail.com>
Sun, 11 Apr 2010 13:40:10 +0000 (13:40 +0000)
SVN revision: 47925

src/modules/everything/e_mod_main.c
src/modules/everything/evry.c
src/modules/everything/evry_history.c
src/modules/everything/evry_plug_aggregator.c

index e9d0de3..25dad38 100644 (file)
@@ -424,10 +424,10 @@ evry_plugin_free(Evry_Plugin *p, int free_pointer)
    if (p->trigger)  eina_stringshare_del(p->trigger);
    if (p->icon)     eina_stringshare_del(p->icon);
 
-   if (!free_pointer)
-     return;
-   else if (p->free)
+   if (p->free)
      p->free(p);
+   else if (!free_pointer)
+     return;
    else
      E_FREE(p);
 }
index bad3bae..873f5d1 100644 (file)
@@ -754,12 +754,13 @@ _evry_selector_free(Evry_Selector *sel)
 
    if (list->visible && (sel == selector))
      _evry_view_clear(sel->state);
-
-   evry_plugin_free(sel->aggregator, 1);
    
    while (sel->states)
      _evry_state_pop(sel);
 
+   if (sel->aggregator)
+     evry_plugin_free(sel->aggregator, 1);
+
    if (sel->actions)
      evry_plug_actions_free(sel->actions);
 
index 99bcc6a..49095af 100644 (file)
@@ -195,6 +195,11 @@ evry_history_unload(void)
 
    e_config_domain_save("module.everything.history", hist_edd, evry_hist);
 
+   eina_hash_foreach(evry_hist->subjects, _hist_free_cb, NULL);
+   eina_hash_foreach(evry_hist->actions,  _hist_free_cb, NULL);
+   eina_hash_free(evry_hist->subjects);
+   eina_hash_free(evry_hist->actions);
+   
    E_FREE(evry_hist);
    evry_hist = NULL;
 }
index a8ae4e7..3cab6eb 100644 (file)
@@ -233,7 +233,9 @@ _action(Evry_Plugin *plugin, const Evry_Item *it)
 static void
 _cleanup(Evry_Plugin *plugin)
 {
-   EVRY_PLUGIN_ITEMS_FREE(plugin);
+   Evry_Item *it;
+   EINA_LIST_FREE(plugin->items, it)
+     evry_item_free(it);
 }
 
 static Evas_Object *
@@ -257,6 +259,7 @@ _plugin_free(Evry_Plugin *plugin)
 {
    PLUGIN(p, plugin);
 
+   E_FREE(plugin->config);
    E_FREE(p);
 }