ui: ensure we clean up properly before exit.

Ensure timer callback gets cancelled before exitting
the mainloop.
This commit is contained in:
Alastair Poole 2018-10-17 10:20:54 +01:00
parent a9a2b7c671
commit 8076a4b96a
2 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,8 @@ ui_shutdown(Ui *ui)
{
evas_object_hide(ui->win);
ui->shutting_down = EINA_TRUE;
if (ui->thread_system)
ecore_thread_cancel(ui->thread_system);
@ -1109,6 +1111,9 @@ _process_panel_update(void *data)
ui = data;
if (ui->shutting_down)
return ECORE_CALLBACK_CANCEL;
proc = proc_info_by_pid(ui->selected_pid);
if (!proc)
{

View File

@ -109,7 +109,6 @@ typedef struct Ui
pid_t program_pid;
Data_Unit data_unit;
const char *data_unit_symbol;
#define TEXT_FIELD_MAX 65535
char *fields[PROCESS_INFO_FIELDS];
@ -127,6 +126,7 @@ typedef struct Ui
Sort_Type sort_type;
Eina_Bool sort_reverse;
Eina_Bool panel_visible;
Eina_Bool shutting_down;
} Ui;
Ui *