summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-10 20:50:12 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-10 20:50:12 +0000
commitb1a7fd93669ea72908848d2a2afb0fba6902660a (patch)
tree941c2a9ace8121b3aa323168e4301a48210f8654 /libs
parent4341e678944d26870d89498b858609b07e480555 (diff)
avoid double delete of UI objects caused by default behaviour of Glib::Private
git-svn-id: svn://localhost/ardour2/branches/3.0@6341 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/pbd/pbd/ui_callback.h4
-rw-r--r--libs/pbd/ui_callback.cc13
2 files changed, 15 insertions, 2 deletions
diff --git a/libs/pbd/pbd/ui_callback.h b/libs/pbd/pbd/ui_callback.h
index d5f4c51f4e..55691eb843 100644
--- a/libs/pbd/pbd/ui_callback.h
+++ b/libs/pbd/pbd/ui_callback.h
@@ -34,8 +34,8 @@ class UICallback
virtual void call_slot (sigc::slot<void> theSlot) = 0;
- static UICallback* get_ui_for_thread() { return thread_ui.get(); }
- static void set_ui_for_thread (UICallback* ui) { return thread_ui.set (ui); }
+ static UICallback* get_ui_for_thread();
+ static void set_ui_for_thread (UICallback* ui);
private:
static Glib::StaticPrivate<UICallback> thread_ui;
diff --git a/libs/pbd/ui_callback.cc b/libs/pbd/ui_callback.cc
index 954d25f637..9a8feb3d2c 100644
--- a/libs/pbd/ui_callback.cc
+++ b/libs/pbd/ui_callback.cc
@@ -4,3 +4,16 @@ using namespace PBD;
Glib::StaticPrivate<UICallback> UICallback::thread_ui;
+static void do_not_delete_the_ui_pointer (void*) { }
+
+UICallback*
+UICallback::get_ui_for_thread() {
+ return thread_ui.get ();
+}
+
+void
+UICallback::set_ui_for_thread (UICallback* ui)
+{
+ thread_ui.set (ui, do_not_delete_the_ui_pointer);
+}
+