Prevent libardour from being initialized more than once
This is not thread safe of course, it is not intended to be. This was implemented as at one stage ARDOUR::init was being called multiple times in the testsuite which was causing a subtle bug that took some time to track down.
This commit is contained in:
parent
d51eba1162
commit
9d340af10d
@ -107,6 +107,8 @@ using namespace ARDOUR;
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
|
||||
bool libardour_initialized = false;
|
||||
|
||||
compute_peak_t ARDOUR::compute_peak = 0;
|
||||
find_peaks_t ARDOUR::find_peaks = 0;
|
||||
apply_gain_to_buffer_t ARDOUR::apply_gain_to_buffer = 0;
|
||||
@ -218,6 +220,10 @@ lotsa_files_please ()
|
||||
bool
|
||||
ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir)
|
||||
{
|
||||
if (libardour_initialized) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Glib::thread_supported()) {
|
||||
Glib::thread_init();
|
||||
}
|
||||
@ -331,6 +337,8 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
|
||||
EventTypeMap::instance().new_parameter(EnvelopeAutomation);
|
||||
EventTypeMap::instance().new_parameter(MidiCCAutomation);
|
||||
|
||||
libardour_initialized = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user