Shutdown properly.
Ask threads to terminate and shutdown EFL properly.
This commit is contained in:
parent
8efee813e0
commit
a8826641d0
|
@ -50,9 +50,9 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
ecore_main_loop_begin();
|
ecore_main_loop_begin();
|
||||||
|
|
||||||
eina_shutdown();
|
|
||||||
ecore_shutdown();
|
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
|
ecore_shutdown();
|
||||||
|
eina_shutdown();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
21
src/ui.c
21
src/ui.c
|
@ -53,12 +53,12 @@ _system_stats_thread_feedback_cb(void *data, Ecore_Thread *thread, void *msg)
|
||||||
double cpu_usage = 0.0;
|
double cpu_usage = 0.0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (ecore_thread_check(thread))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ui = data;
|
ui = data;
|
||||||
results = msg;
|
results = msg;
|
||||||
|
|
||||||
|
if (ecore_thread_check(thread))
|
||||||
|
goto out;
|
||||||
|
|
||||||
_cpu_view_update(ui, results);
|
_cpu_view_update(ui, results);
|
||||||
_memory_view_update(ui, results);
|
_memory_view_update(ui, results);
|
||||||
_disk_view_update(ui);
|
_disk_view_update(ui);
|
||||||
|
@ -79,6 +79,7 @@ _system_stats_thread_feedback_cb(void *data, Ecore_Thread *thread, void *msg)
|
||||||
elm_progressbar_value_set(ui->progress_cpu, (double) cpu_usage / 100);
|
elm_progressbar_value_set(ui->progress_cpu, (double) cpu_usage / 100);
|
||||||
elm_progressbar_value_set(ui->progress_mem, (double)((results->memory.total / 100.0) * results->memory.used) / 1000000);
|
elm_progressbar_value_set(ui->progress_mem, (double)((results->memory.total / 100.0) * results->memory.used) / 1000000);
|
||||||
|
|
||||||
|
out:
|
||||||
free(results->cores);
|
free(results->cores);
|
||||||
free(results);
|
free(results);
|
||||||
}
|
}
|
||||||
|
@ -556,9 +557,15 @@ _btn_state_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
|
||||||
static void
|
static void
|
||||||
_btn_quit_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_btn_quit_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
ecore_main_loop_quit();
|
Ui *ui = data;
|
||||||
|
|
||||||
elm_exit();
|
ecore_thread_cancel(ui->thread_system);
|
||||||
|
ecore_thread_cancel(ui->thread_process);
|
||||||
|
|
||||||
|
ecore_thread_wait(ui->thread_system, 1.0);
|
||||||
|
ecore_thread_wait(ui->thread_process, 1.0);
|
||||||
|
|
||||||
|
ecore_main_loop_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2120,7 +2127,7 @@ ui_add(Evas_Object *parent)
|
||||||
_disk_view_update(ui);
|
_disk_view_update(ui);
|
||||||
_process_panel_update(ui);
|
_process_panel_update(ui);
|
||||||
|
|
||||||
ecore_thread_feedback_run(_system_stats_thread, _system_stats_thread_feedback_cb, _thread_end_cb, _thread_error_cb, ui, EINA_FALSE);
|
ui->thread_system = ecore_thread_feedback_run(_system_stats_thread, _system_stats_thread_feedback_cb, _thread_end_cb, _thread_error_cb, ui, EINA_FALSE);
|
||||||
ecore_thread_feedback_run(_system_process_list, _system_process_list_feedback_cb, _thread_end_cb, _thread_error_cb, ui, EINA_FALSE);
|
ui->thread_process = ecore_thread_feedback_run(_system_process_list, _system_process_list_feedback_cb, _thread_end_cb, _thread_error_cb, ui, EINA_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
src/ui.h
3
src/ui.h
|
@ -95,6 +95,9 @@ typedef struct Ui
|
||||||
Evas_Object *entry_pid_state;
|
Evas_Object *entry_pid_state;
|
||||||
Evas_Object *entry_pid_cpu_usage;
|
Evas_Object *entry_pid_cpu_usage;
|
||||||
|
|
||||||
|
Ecore_Thread *thread_system;
|
||||||
|
Ecore_Thread *thread_process;
|
||||||
|
|
||||||
Ecore_Timer *timer_pid;
|
Ecore_Timer *timer_pid;
|
||||||
pid_t selected_pid;
|
pid_t selected_pid;
|
||||||
pid_t program_pid;
|
pid_t program_pid;
|
||||||
|
|
Loading…
Reference in New Issue