mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Use weak-ptr for source added/removed signals (2/2)
This commit is contained in:
parent
ab58c894d3
commit
b228dce1c1
2 changed files with 11 additions and 1 deletions
|
|
@ -287,7 +287,7 @@ EditorSources::set_session (ARDOUR::Session* s)
|
|||
|
||||
ARDOUR::RegionFactory::CheckNewRegion.connect (add_source_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::add_source, this, _1), gui_context());
|
||||
|
||||
s->SourceRemoved.connect (remove_source_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::remove_source, this, _1), gui_context());
|
||||
s->SourceRemoved.connect (remove_source_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::remove_weak_source, this, _1), gui_context());
|
||||
|
||||
redisplay();
|
||||
|
||||
|
|
@ -296,6 +296,15 @@ EditorSources::set_session (ARDOUR::Session* s)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
EditorSources::remove_weak_source (boost::weak_ptr<ARDOUR::Source> src)
|
||||
{
|
||||
boost::shared_ptr<ARDOUR::Source> source = src.lock();
|
||||
if (source) {
|
||||
remove_source (source);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
EditorSources::remove_source (boost::shared_ptr<ARDOUR::Source> source)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue