lock source list when destroying it.

This commit is contained in:
Robin Gareus 2014-01-19 22:37:01 +01:00
parent b3dd518b22
commit ca8fa56b61

View file

@ -526,13 +526,16 @@ Session::destroy ()
} }
routes.flush (); routes.flush ();
DEBUG_TRACE (DEBUG::Destruction, "delete sources\n"); {
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) { DEBUG_TRACE (DEBUG::Destruction, "delete sources\n");
DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for source %1 ; pre-ref = %2\n", i->second->name(), i->second.use_count())); Glib::Threads::Mutex::Lock lm (source_lock);
i->second->drop_references (); for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
} DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for source %1 ; pre-ref = %2\n", i->second->name(), i->second.use_count()));
i->second->drop_references ();
}
sources.clear (); sources.clear ();
}
DEBUG_TRACE (DEBUG::Destruction, "delete route groups\n"); DEBUG_TRACE (DEBUG::Destruction, "delete route groups\n");
for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) { for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {