diff options
author | David Robillard <d@drobilla.net> | 2009-05-12 19:15:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-12 19:15:07 +0000 |
commit | ddc09de45b45bdf2afdeff68eb8a17ad237ef6c3 (patch) | |
tree | d71c279860fb016e79be2fb7ea1ba3fa66e6babd /src/Patchage.cpp | |
parent | 61e8765a7b9afda01eb52b5a240701849fd9e116 (diff) | |
download | patchage-ddc09de45b45bdf2afdeff68eb8a17ad237ef6c3.tar.gz patchage-ddc09de45b45bdf2afdeff68eb8a17ad237ef6c3.tar.bz2 patchage-ddc09de45b45bdf2afdeff68eb8a17ad237ef6c3.zip |
Fix threading issues on Jack exit.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@1988 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r-- | src/Patchage.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index b00013b..eaa252d 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -102,6 +102,7 @@ Patchage::Patchage(int argc, char** argv) , _jack_driver(NULL) , _state_manager(NULL) , _attach(true) + , _driver_detached(false) , _refresh(false) , _enable_refresh(true) , INIT_WIDGET(_about_win) @@ -239,7 +240,7 @@ Patchage::Patchage(int argc, char** argv) #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) _jack_driver = new JackDriver(this); - _jack_driver->signal_detached.connect(sigc::mem_fun(this, &Patchage::queue_refresh)); + _jack_driver->signal_detached.connect(sigc::mem_fun(this, &Patchage::driver_detached)); _menu_jack_connect->signal_activate().connect(sigc::bind( sigc::mem_fun(_jack_driver, &JackDriver::attach), true)); @@ -340,8 +341,15 @@ Patchage::idle_callback() // Do a full refresh (ie user clicked refresh) if (_refresh) { refresh(); - _refresh = false; + } else if (_driver_detached) { + if (_jack_driver && !_jack_driver->is_attached()) + _jack_driver->destroy_all(); + if (_alsa_driver && !_alsa_driver->is_attached()) + _alsa_driver->destroy_all(); } + + _refresh = false; + _driver_detached = false; flush_resize(); update_load(); |