[gnome-control-center] wacom: Fix warning with unfinished timer
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] wacom: Fix warning with unfinished timer
- Date: Tue, 10 Jan 2012 20:39:32 +0000 (UTC)
commit a5f7b091068f5ebd388703701ed22db9849089e7
Author: Bastien Nocera <hadess hadess net>
Date: Tue Jan 10 20:34:38 2012 +0000
wacom: Fix warning with unfinished timer
We need to remove the timeout once we're done, otherwise it
will keep on running.
panels/wacom/calibrator/gui_gtk.c | 4 +++-
panels/wacom/calibrator/gui_gtk.h | 2 ++
2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/panels/wacom/calibrator/gui_gtk.c b/panels/wacom/calibrator/gui_gtk.c
index af1179f..ae02e00 100644
--- a/panels/wacom/calibrator/gui_gtk.c
+++ b/panels/wacom/calibrator/gui_gtk.c
@@ -324,7 +324,7 @@ CalibrationArea_(struct Calib *c)
}
/* Setup timer for animation */
- g_timeout_add(time_step, (GSourceFunc)on_timer_signal, calib_area);
+ calib_area->anim_id = g_timeout_add(time_step, (GSourceFunc)on_timer_signal, calib_area);
return calib_area;
}
@@ -370,6 +370,8 @@ run_gui(struct Calib *c,
gtk_main();
+ g_source_remove (calib_area->anim_id);
+
success = finish(calib_area->calibrator, calib_area->display_width, calib_area->display_height, new_axis, swap);
g_debug ("Final calibration: %d, %d, %d, %d\n",
diff --git a/panels/wacom/calibrator/gui_gtk.h b/panels/wacom/calibrator/gui_gtk.h
index bcad1a3..72f27d1 100644
--- a/panels/wacom/calibrator/gui_gtk.h
+++ b/panels/wacom/calibrator/gui_gtk.h
@@ -38,6 +38,8 @@ struct CalibArea
const char* message;
GtkWidget *drawing_area;
+
+ guint anim_id;
};
gboolean run_gui (struct Calib *c,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]