e_process: fix the problem that turn into a infinite loop while freeing inlist. 16/86816/2
authorSeunghun Lee <shiin.lee@samsung.com>
Mon, 5 Sep 2016 05:04:34 +0000 (14:04 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 5 Sep 2016 05:40:22 +0000 (22:40 -0700)
According to note of EINA_INLIST_FREE(),
NOTE: it is the duty of the body loop to properly remove the item from the
inlist and free it. This function will turn into a infinite loop if you
don't remove all items from the list.

Change-Id: Iaa5ee885d754d493f5a74feb2364045993f5fef9

src/bin/e_process.c

index 8825ab6..325c044 100644 (file)
@@ -459,6 +459,7 @@ _e_process_manager_del(E_Process_Manager *pm)
 
    EINA_INLIST_FREE(pm->process_list, pinfo)
      {
+        pm->process_list = eina_inlist_remove(pm->process_list, EINA_INLIST_GET(pinfo));
         eina_list_free(pinfo->ec_list);
         eina_hash_del_by_key(pm->pids_hash, &pinfo->pid);
         E_FREE(pinfo);