Do not emit MixerScene signal with locked mutex (fixes ndeadlck)

This commit is contained in:
Robin Gareus
2022-05-26 16:17:39 +02:00
parent 30c073f669
commit 927562678b
2 changed files with 12 additions and 10 deletions

View File

@@ -34,12 +34,10 @@ PBD::Signal0<void> MixerScene::Change;
MixerScene::MixerScene (Session& s)
: SessionHandleRef (s)
{
Change (); /* EMIT SIGNAL */
}
MixerScene::~MixerScene ()
{
Change (); /* EMIT SIGNAL */
}
bool

View File

@@ -7499,14 +7499,19 @@ Session::nth_mixer_scene_valid (size_t nth) const
bool
Session::apply_nth_mixer_scene (size_t nth)
{
Glib::Threads::RWLock::ReaderLock lm (_mixer_scenes_lock);
if (_mixer_scenes.size () <= nth) {
return false;
boost::shared_ptr<MixerScene> scene;
{
Glib::Threads::RWLock::ReaderLock lm (_mixer_scenes_lock);
if (_mixer_scenes.size () <= nth) {
return false;
}
if (!_mixer_scenes[nth]) {
return false;
}
scene = _mixer_scenes[nth];
}
if (!_mixer_scenes[nth]) {
return false;
}
return _mixer_scenes[nth]->apply ();
assert (scene);
return scene->apply ();
}
void
@@ -7524,7 +7529,6 @@ Session::nth_mixer_scene (size_t nth, bool create_if_missing)
Glib::Threads::RWLock::WriterLock lw (_mixer_scenes_lock);
_mixer_scenes.resize (nth + 1);
_mixer_scenes[nth] = boost::shared_ptr<MixerScene> (new MixerScene (*this));
set_dirty ();
return _mixer_scenes[nth];
}
if (_mixer_scenes.size () <= nth) {