mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +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());
|
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();
|
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
|
void
|
||||||
EditorSources::remove_source (boost::shared_ptr<ARDOUR::Source> source)
|
EditorSources::remove_source (boost::shared_ptr<ARDOUR::Source> source)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ private:
|
||||||
|
|
||||||
void add_source (boost::shared_ptr<ARDOUR::Region>);
|
void add_source (boost::shared_ptr<ARDOUR::Region>);
|
||||||
void remove_source (boost::shared_ptr<ARDOUR::Source>);
|
void remove_source (boost::shared_ptr<ARDOUR::Source>);
|
||||||
|
void remove_weak_source (boost::weak_ptr<ARDOUR::Source>);
|
||||||
|
|
||||||
void clock_format_changed ();
|
void clock_format_changed ();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue