#include <iostream>
#include "pbd/controllable.h"
+#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/keyboard.h"
#include "widgets/binding_proxy.h"
#include "widgets/popup.h"
: prompter (0),
controllable (c)
{
+ if (c) {
+ c->DropReferences.connect (
+ _controllable_going_away_connection, invalidator (*this),
+ boost::bind (&BindingProxy::set_controllable, this, boost::shared_ptr<Controllable> ()),
+ gui_context());
+ }
}
BindingProxy::BindingProxy ()
{
learning_finished ();
controllable = c;
+
+ _controllable_going_away_connection.disconnect ();
+ if (c) {
+ c->DropReferences.connect (
+ _controllable_going_away_connection, invalidator (*this),
+ boost::bind (&BindingProxy::set_controllable, this, boost::shared_ptr<Controllable> ()),
+ gui_context());
+ }
}
void
static guint bind_statemask;
PBD::ScopedConnection learning_connection;
+ PBD::ScopedConnection _controllable_going_away_connection;
void learning_finished ();
bool prompter_hiding (GdkEventAny *);
};