summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-02-02 23:52:46 +0100
committerGravatar Martin Szulecki2010-02-03 00:03:47 +0100
commit8cead47dc51e330facfc6d19f47f4c912121eeb3 (patch)
tree7aae25a9c0f8b59cbbbd056392cd3abc4fc6e94c /src
parent63624f91954534232279c67c10b79634f1884114 (diff)
downloadsbmanager-8cead47dc51e330facfc6d19f47f4c912121eeb3.tar.gz
sbmanager-8cead47dc51e330facfc6d19f47f4c912121eeb3.tar.bz2
Cleanly exit battery updater thread after gui_deinit
Diffstat (limited to 'src')
-rw-r--r--src/gui.c7
1 files changed, 7 insertions, 0 deletions
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;
}