cross-thread handling of SessionEvent allocation/deallocation, with widespread conseq...
[ardour.git] / libs / ardour / globals.cc
index 6e6ae9bf802a07164f4707c6ffe2dcb9cfe311d1..9953524c34b6ed17373725e451032d6018e9aecc 100644 (file)
@@ -72,6 +72,7 @@
 #include "ardour/rc_configuration.h"
 #include "ardour/runtime_functions.h"
 #include "ardour/session.h"
+#include "ardour/session_event.h"
 #include "ardour/source_factory.h"
 #include "ardour/utils.h"
 
@@ -110,6 +111,8 @@ mix_buffers_no_gain_t   ARDOUR::mix_buffers_no_gain = 0;
 
 sigc::signal<void,std::string> ARDOUR::BootMessage;
 
+void ARDOUR::setup_enum_writer ();
+
 int
 ARDOUR::setup_midi ()
 {
@@ -283,14 +286,15 @@ lotsa_files_please ()
 int
 ARDOUR::init (bool use_vst, bool try_optimization)
 {
-       if (!Glib::thread_supported())
+       if (!Glib::thread_supported()) {
                Glib::thread_init();
+       }
 
-       PBD::ID::init ();
+       (void) bindtextdomain(PACKAGE, LOCALEDIR);
 
-       extern void setup_enum_writer ();
+       PBD::ID::init ();
+       SessionEvent::init_event_pool ();
 
-       (void) bindtextdomain(PACKAGE, LOCALEDIR);
 
        /* provide a state version for the few cases that need it and are not
           driven by reading state from disk (e.g. undo/redo)