projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warning.
[ardour.git]
/
gtk2_ardour
/
route_processor_selection.cc
diff --git
a/gtk2_ardour/route_processor_selection.cc
b/gtk2_ardour/route_processor_selection.cc
index 1af1e0c968f393aea11b0f9ad6d2ca6617b9ced1..b3a6620f6bf1bca3f56fea40f7c90d7857ae642b 100644
(file)
--- a/
gtk2_ardour/route_processor_selection.cc
+++ b/
gtk2_ardour/route_processor_selection.cc
@@
-26,6
+26,7
@@
#include "ardour/route.h"
#include "route_processor_selection.h"
#include "ardour/route.h"
#include "route_processor_selection.h"
+#include "gui_thread.h"
#include "i18n.h"
#include "i18n.h"
@@
-68,6
+69,7
@@
void
RouteRedirectSelection::clear_routes ()
{
routes.clear ();
RouteRedirectSelection::clear_routes ()
{
routes.clear ();
+ drop_connections ();
RoutesChanged ();
}
RoutesChanged ();
}
@@
-92,18
+94,28
@@
RouteRedirectSelection::add (boost::shared_ptr<Route> r)
{
if (find (routes.begin(), routes.end(), r) == routes.end()) {
routes.push_back (r);
{
if (find (routes.begin(), routes.end(), r) == routes.end()) {
routes.push_back (r);
+ r->DropReferences.connect (*this, MISSING_INVALIDATOR, boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r)), gui_context());
+ RoutesChanged();
+ }
+}
- // XXX SHAREDPTR FIXME
- // void (RouteRedirectSelection::*pmf)(Route*) = &RouteRedirectSelection::remove;
- // r->GoingAway.connect (sigc::bind (sigc::mem_fun(*this, pmf), r));
+void
+RouteRedirectSelection::removed (boost::weak_ptr<Route> wr)
+{
+ boost::shared_ptr<Route> r (wr.lock());
- RoutesChanged();
+ if (!r) {
+ return;
}
}
+
+ remove (r);
}
void
RouteRedirectSelection::remove (boost::shared_ptr<Route> r)
{
}
void
RouteRedirectSelection::remove (boost::shared_ptr<Route> r)
{
+ ENSURE_GUI_THREAD (*this, &RouteRedirectSelection::remove, r);
+
list<boost::shared_ptr<Route> >::iterator i;
if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
routes.erase (i);
list<boost::shared_ptr<Route> >::iterator i;
if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
routes.erase (i);