13
0

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
This commit is contained in:
Paul Davis 2009-12-10 20:50:12 +00:00
parent 4341e67894
commit b1a7fd9366
2 changed files with 15 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}