diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-12-19 16:21:24 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-12-19 16:21:24 +0000 |
commit | 27cf4b989cc1d03ecb8c3629aeb9f592a6b3ea9f (patch) | |
tree | b97aa75d42b8a13168b997560b69542e4eb32f2b /libs/ardour | |
parent | 434f3e6296f3b31bd6cca588f97f14c94c3af119 (diff) |
potential fix for crashing bug caused by mutex lifetime in ~AudioDiskstream
git-svn-id: svn://localhost/ardour2/trunk@1231 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index e30c683d8e..e3b4c2b61b 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -168,12 +168,18 @@ AudioDiskstream::destroy_channel (ChannelInfo &chan) AudioDiskstream::~AudioDiskstream () { - Glib::Mutex::Lock lm (state_lock); + { + /* don't be holding this lock as we exit the destructor, glib will wince + visibly since the mutex gets destroyed before we release it. + */ - for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) - destroy_channel((*chan)); - - channels.clear(); + Glib::Mutex::Lock lm (state_lock); + + for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) + destroy_channel((*chan)); + + channels.clear(); + } } void |