From 8cead47dc51e330facfc6d19f47f4c912121eeb3 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 2 Feb 2010 23:52:46 +0100 Subject: Cleanly exit battery updater thread after gui_deinit --- src/gui.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/gui.c b/src/gui.c index 910e8dc..5154cde 100644 --- a/src/gui.c +++ b/src/gui.c @@ -110,6 +110,8 @@ static device_info_cb_t device_info_callback = NULL; int current_page = 0; struct timeval last_page_switch; +static int gui_deinitialized = 0; + static void gui_page_indicator_group_add(GList *page, int page_index); static void gui_page_align_icons(guint page_num, gboolean animated); @@ -1161,6 +1163,10 @@ static gboolean update_battery_info_cb(gpointer user_data) GError *error = NULL; gboolean res = TRUE; + if (gui_deinitialized) { + return FALSE; + } + if (device_get_info(uuid, &device_info, &error)) { clutter_actor_set_size(battery_level, (guint) (((double) (device_info->battery_capacity) / 100.0) * 15), 6); if (device_info->battery_capacity == 100) { @@ -1356,4 +1362,5 @@ void gui_deinit() { clutter_timeline_stop(clock_timeline); device_info_free(device_info); + gui_deinitialized = 1; } -- cgit v1.1-32-gdbae