diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc index 6c9a095d6d..83df2b76b5 100644 --- a/libs/pbd/base_ui.cc +++ b/libs/pbd/base_ui.cc @@ -119,12 +119,11 @@ BaseUI::run () m_context = MainContext::create(); _main_loop = MainLoop::create (m_context); + attach_request_source (); Glib::Threads::Mutex::Lock lm (_run_lock); _run_loop_thread = PBD::Thread::create (boost::bind (&BaseUI::main_thread, this)); _running.wait (_run_lock); - - attach_request_source (); } void diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h index 27bdb71644..fff6f5da84 100644 --- a/libs/pbd/pbd/base_ui.h +++ b/libs/pbd/pbd/base_ui.h @@ -53,7 +53,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop BaseUI* base_instance() { return base_ui_instance; } Glib::RefPtr main_loop() const { return _main_loop; } - bool caller_is_self () const { assert (_run_loop_thread); return _run_loop_thread->caller_is_self (); } + bool caller_is_self () const { return _run_loop_thread ? _run_loop_thread->caller_is_self () : true; } bool ok() const { return _ok; }