netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=6b47ad6aac20d025d8adbd29c4cc887b2aa67bf1

commit 6b47ad6aac20d025d8adbd29c4cc887b2aa67bf1
Author: Alastair Poole <nets...@gmail.com>
Date:   Wed Jan 20 12:49:11 2021 +0000

    view: leak fix
---
 src/bin/ui/ui_process_view.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/bin/ui/ui_process_view.c b/src/bin/ui/ui_process_view.c
index 5d078f2..c6d543a 100644
--- a/src/bin/ui/ui_process_view.c
+++ b/src/bin/ui/ui_process_view.c
@@ -439,9 +439,6 @@ _thread_info_set(Ui_Data *pd, Proc_Info *proc)
    Elm_Object_Item *it;
    Eina_List *l, *threads = NULL;
 
-   if (!pd->hash_cpu_times)
-     pd->hash_cpu_times = eina_hash_string_superfast_new(_hash_free_cb);
-
    _genlist_ensure_n_items(pd->genlist_threads, 
eina_list_count(proc->threads));
 
    EINA_LIST_FOREACH(proc->threads, l, p)
@@ -748,6 +745,9 @@ _threads_cpu_usage(Ui_Data *pd, Proc_Info *proc)
    Eina_List *l;
    Proc_Info *p;
 
+   if (!pd->hash_cpu_times)
+     pd->hash_cpu_times = eina_hash_string_superfast_new(_hash_free_cb);
+
    EINA_LIST_FOREACH(proc->threads, l, p)
      {
         long *cpu_time, *cpu_time_prev;
@@ -787,6 +787,8 @@ _proc_info_feedback_cb(void *data, Ecore_Thread *thread, 
void *msg)
         return;
      }
 
+   if (ecore_thread_check(thread)) return;
+
    _threads_cpu_usage(pd, proc);
 
    if (pd->poll_count != 0 && (pd->poll_count % 10))
@@ -1526,15 +1528,14 @@ _win_del_cb(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED,
    pd  = data;
    win = obj;
 
-   if (pd->hash_cpu_times)
-     eina_hash_free(pd->hash_cpu_times);
-
    if (pd->thread)
      {
         ecore_thread_cancel(pd->thread);
         ecore_thread_wait(pd->thread, 0.5);
      }
 
+   if (pd->hash_cpu_times)
+     eina_hash_free(pd->hash_cpu_times);
    if (pd->selected_cmd)
      free(pd->selected_cmd);
    if (pd->cache)

-- 


Reply via email to