mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Less subtle attempt to prevent crashes on removing sources during session deletion.
git-svn-id: svn://localhost/ardour2/branches/3.0@9028 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
865f4db12e
commit
fa41cfef58
1 changed files with 5 additions and 8 deletions
|
|
@ -302,15 +302,9 @@ Session::destroy ()
|
||||||
routes.flush ();
|
routes.flush ();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Destruction, "delete sources\n");
|
DEBUG_TRACE (DEBUG::Destruction, "delete sources\n");
|
||||||
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ) {
|
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
|
||||||
|
|
||||||
SourceMap::iterator j = i;
|
|
||||||
++j;
|
|
||||||
|
|
||||||
DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for source %1 ; pre-ref = %2\n", i->second->path(), i->second.use_count()));
|
DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for source %1 ; pre-ref = %2\n", i->second->path(), i->second.use_count()));
|
||||||
i->second->drop_references ();
|
i->second->drop_references ();
|
||||||
|
|
||||||
i = j;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sources.clear ();
|
sources.clear ();
|
||||||
|
|
@ -2697,6 +2691,10 @@ Session::add_source (boost::shared_ptr<Source> source)
|
||||||
void
|
void
|
||||||
Session::remove_source (boost::weak_ptr<Source> src)
|
Session::remove_source (boost::weak_ptr<Source> src)
|
||||||
{
|
{
|
||||||
|
if (_state_of_the_state & Deletion) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SourceMap::iterator i;
|
SourceMap::iterator i;
|
||||||
boost::shared_ptr<Source> source = src.lock();
|
boost::shared_ptr<Source> source = src.lock();
|
||||||
|
|
||||||
|
|
@ -2708,7 +2706,6 @@ Session::remove_source (boost::weak_ptr<Source> src)
|
||||||
Glib::Mutex::Lock lm (source_lock);
|
Glib::Mutex::Lock lm (source_lock);
|
||||||
|
|
||||||
if ((i = sources.find (source->id())) != sources.end()) {
|
if ((i = sources.find (source->id())) != sources.end()) {
|
||||||
cerr << "Removing source " << source->name() << endl;
|
|
||||||
sources.erase (i);
|
sources.erase (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue