From 2c3cbd04b0d62382bad891e7933f709ef48c4be1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 18 Nov 2012 01:33:02 +0000 Subject: Disconnect animation signal when canvas is destroyed (fix potential crashes on shutdown). git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4830 a436a847-0d15-0410-975c-d299462d15a1 --- ganv/Canvas.hpp | 2 ++ src/Canvas.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index 886102b..7d12286 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -128,6 +128,8 @@ private: inline GanvCanvasImpl* impl() { return _gobj->impl; } inline const GanvCanvasImpl* impl() const { return _gobj->impl; } + sigc::connection _animate_connection; + GanvCanvas* const _gobj; }; diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 057b841..7674813 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -1485,12 +1485,13 @@ Canvas::Canvas(double width, double height) g_signal_connect(gobj(), "disconnect", G_CALLBACK(on_disconnect), this); - Glib::signal_timeout().connect( + _animate_connection = Glib::signal_timeout().connect( sigc::mem_fun(impl(), &GanvCanvasImpl::animate_selected), 120); } Canvas::~Canvas() { + _animate_connection.disconnect(); destroy(); delete impl(); } -- cgit v1.2.1