Use weak-ptr for source added/removed signals (2/2)
This commit is contained in:
parent
ab58c894d3
commit
b228dce1c1
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -120,6 +120,7 @@ private:
|
|||
|
||||
void add_source (boost::shared_ptr<ARDOUR::Region>);
|
||||
void remove_source (boost::shared_ptr<ARDOUR::Source>);
|
||||
void remove_weak_source (boost::weak_ptr<ARDOUR::Source>);
|
||||
|
||||
void clock_format_changed ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue