summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-03-16 22:43:30 +0000
committerDavid Robillard <d@drobilla.net>2015-03-16 22:43:30 +0000
commite13eb3724dadd1b9dfcd108317e6c39a15c748d2 (patch)
treed2f302158583fecdf45f764155a24ae3d2dfcbf7
parent23e7488b8628022ade48f511c6354addfabf3f44 (diff)
downloadganv-e13eb3724dadd1b9dfcd108317e6c39a15c748d2.tar.gz
ganv-e13eb3724dadd1b9dfcd108317e6c39a15c748d2.tar.bz2
ganv-e13eb3724dadd1b9dfcd108317e6c39a15c748d2.zip
Fix removal of non-existent idle callbacks.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5638 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/Canvas.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp
index 0adc78a..a30657b 100644
--- a/src/Canvas.cpp
+++ b/src/Canvas.cpp
@@ -268,8 +268,12 @@ struct GanvCanvasImpl {
~GanvCanvasImpl()
{
- g_source_remove(_animate_idle_id);
- while (g_idle_remove_by_data(this)) ;
+ if (_animate_idle_id) {
+ g_source_remove(_animate_idle_id);
+ _animate_idle_id = 0;
+ }
+
+ while (g_idle_remove_by_data(this)) {}
ganv_canvas_clear(_gcanvas);
gdk_cursor_unref(_move_cursor);
}
@@ -2879,7 +2883,10 @@ ganv_canvas_unrealize(GtkWidget* widget)
GanvCanvas* canvas = GANV_CANVAS(widget);
- g_source_remove(canvas->impl->_animate_idle_id);
+ if (canvas->impl->_animate_idle_id) {
+ g_source_remove(canvas->impl->_animate_idle_id);
+ canvas->impl->_animate_idle_id = 0;
+ }
while (g_idle_remove_by_data(canvas->impl)) {}
shutdown_transients(canvas);