X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fgtk_ui.cc;h=d1601468591945033b5954fd07887ef28eed3d1c;hb=4b9e7386360746232dbdf2609b4e23ef02b0c5e9;hp=9c20da0f4c2eea27e7cfe7cca65eb181d39237f3;hpb=0da34e65e3470b1c2298ddf571df6356d0d42bd8;p=ardour.git diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 9c20da0f4c..d160146859 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -43,6 +43,7 @@ #include "gtkmm2ext/actions.h" #include "gtkmm2ext/activatable.h" #include "gtkmm2ext/actions.h" +#include "gtkmm2ext/gui_thread.h" #include "i18n.h" @@ -64,20 +65,25 @@ BaseUI::RequestType Gtkmm2ext::AddTimeout = BaseUI::new_request_type(); #include "pbd/abstract_ui.cc" /* instantiate the template */ +template class AbstractUI; + UI::UI (string namestr, int *argc, char ***argv) : AbstractUI (namestr) , _receiver (*this) - + , errors (0) + { theMain = new Main (argc, argv); + pthread_set_name ("gui"); + _active = false; if (!theGtkUI) { theGtkUI = this; } else { fatal << "duplicate UI requested" << endmsg; - /* NOTREACHED */ + abort(); /* NOTREACHED */ } /* the GUI event loop runs in the main thread of the app, @@ -85,7 +91,7 @@ UI::UI (string namestr, int *argc, char ***argv) */ run_loop_thread = Threads::Thread::self(); - + /* store "this" as the UI-for-thread of this thread, same argument as for previous line. */ @@ -120,9 +126,10 @@ UI::UI (string namestr, int *argc, char ***argv) UI::~UI () { + _receiver.hangup (); + delete (errors); } - bool UI::caller_is_ui_thread () { @@ -135,9 +142,9 @@ UI::load_rcfile (string path, bool themechange) /* Yes, pointers to Glib::RefPtr. If these are not kept around, * a segfault somewhere deep in the wonderfully robust glib will result. * This does not occur if wiget.get_style is used instead of rc.get_style below, - * except that doesn't actually work... + * except that doesn't actually work... */ - + static Glib::RefPtr