diff options
author | David Robillard <d@drobilla.net> | 2011-10-09 20:54:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-10-09 20:54:18 +0000 |
commit | 64d33fe4054c31d2d22e251293058780ec8fbf98 (patch) | |
tree | 1d9f7748be001b48a0b0a139314930890c9fb8a0 /src/server/JackDriver.cpp | |
parent | ca12acb6cb9b1f7618b88f2c95efd8ab275e1f57 (diff) | |
download | ingen-64d33fe4054c31d2d22e251293058780ec8fbf98.tar.gz ingen-64d33fe4054c31d2d22e251293058780ec8fbf98.tar.bz2 ingen-64d33fe4054c31d2d22e251293058780ec8fbf98.zip |
Fix memory errors in Jack2 caused by jack creating several threads.
This is not really correct since Ingen assumes any jack created thread
is the process thread. Probably not harmful, though it would certainly
be nice to know (in code) what the role and properties of these other
threads are...
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3539 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/JackDriver.cpp')
-rw-r--r-- | src/server/JackDriver.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 246d6fdb..2e2f7c0c 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -186,7 +186,6 @@ JackPort::post_process(ProcessContext& context) JackDriver::JackDriver(Engine& engine) : _engine(engine) - , _jack_thread(NULL) , _sem(0) , _flag(0) , _client(NULL) @@ -206,8 +205,6 @@ JackDriver::~JackDriver() if (_client) jack_client_close(_client); - - delete _jack_thread; } bool @@ -324,8 +321,7 @@ JackDriver::deactivate() _client = NULL; } - delete _jack_thread; - _jack_thread = NULL; + _jack_threads.clear(); LOG(info) << "Deactivated Jack client" << endl; } @@ -487,13 +483,10 @@ JackDriver::_process_cb(jack_nframes_t nframes) void JackDriver::_thread_init_cb() { - if (_jack_thread) { - delete _jack_thread; - } - - _jack_thread = &Thread::get(); - _jack_thread->set_name("Jack"); - _jack_thread->set_context(THREAD_PROCESS); + Raul::Thread* thread = &Thread::get(); + thread->set_name("Jack"); + thread->set_context(THREAD_PROCESS); + _jack_threads.push_back(SharedPtr<Raul::Thread>(thread)); } void @@ -501,8 +494,7 @@ JackDriver::_shutdown_cb() { LOG(info) << "Jack shutdown. Exiting." << endl; _is_activated = false; - delete _jack_thread; - _jack_thread = NULL; + _jack_threads.clear(); _client = NULL; } |