diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-30 15:18:43 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-30 15:18:43 +0000 |
commit | 14b0ca31bcb62e5b7e9e77634ef9cd2e8cf65800 (patch) | |
tree | 494bcf5351ff29d9981c22450863982b93a91a71 /libs/pbd/pbd/signals.h | |
parent | 10c257039df399fc5a9c383434ee19abab6199ed (diff) |
handle deletion of UI objects between the time that a callback is queued with the UI event loop and the execution of the callback (intrusive, big)
git-svn-id: svn://localhost/ardour2/branches/3.0@6807 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/signals.h')
-rw-r--r-- | libs/pbd/pbd/signals.h | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index ffb0dcebb6..8e2b120b10 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -88,15 +88,17 @@ public: } void connect (ScopedConnectionList& clist, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - clist.add_connection (_signal.connect (boost::bind (&EventLoop::call_slot, event_loop, slot))); + clist.add_connection (_signal.connect (boost::bind (&EventLoop::call_slot, event_loop, ir, slot))); } void connect (Connection& c, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - c = _signal.connect (boost::bind (&EventLoop::call_slot, event_loop, slot)); + c = _signal.connect (boost::bind (&EventLoop::call_slot, event_loop, ir, slot)); } typename SignalType::result_type operator()() { @@ -125,20 +127,22 @@ public: c = _signal.connect (slot); } - static void compositor (typename boost::function<void(A)> f, EventLoop* event_loop, A arg) { - event_loop->call_slot (boost::bind (f, arg)); + static void compositor (typename boost::function<void(A)> f, EventLoop* event_loop, EventLoop::InvalidationRecord* ir, A arg) { + event_loop->call_slot (ir, boost::bind (f, arg)); } void connect (ScopedConnectionList& clist, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, _1))); + clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1))); } void connect (Connection& c, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - c = _signal.connect (boost::bind (&compositor, slot, event_loop, _1)); + c = _signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1)); } @@ -168,20 +172,24 @@ public: c = _signal.connect (slot); } - static void compositor (typename boost::function<void(A1,A2)> f, PBD::EventLoop* event_loop, A1 arg1, A2 arg2) { - event_loop->call_slot (boost::bind (f, arg1, arg2)); + static void compositor (typename boost::function<void(A1,A2)> f, PBD::EventLoop* event_loop, + EventLoop::InvalidationRecord* ir, + A1 arg1, A2 arg2) { + event_loop->call_slot (ir, boost::bind (f, arg1, arg2)); } void connect (ScopedConnectionList& clist, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, _1, _2))); + clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2))); } void connect (Connection& c, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - c = _signal.connect (boost::bind (&compositor, slot, event_loop, _1, _2)); + c = _signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2)); } typename SignalType::result_type operator()(A1 arg1, A2 arg2) { @@ -210,20 +218,24 @@ public: c = _signal.connect (slot); } - static void compositor (typename boost::function<void(A1,A2,A3)> f, PBD::EventLoop* event_loop, A1 arg1, A2 arg2, A3 arg3) { - event_loop->call_slot (boost::bind (f, arg1, arg2, arg3)); + static void compositor (typename boost::function<void(A1,A2,A3)> f, PBD::EventLoop* event_loop, + EventLoop::InvalidationRecord* ir, + A1 arg1, A2 arg2, A3 arg3) { + event_loop->call_slot (ir, boost::bind (f, arg1, arg2, arg3)); } void connect (ScopedConnectionList& clist, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, _1, _2, _3))); + clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2, _3))); } void connect (Connection& c, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - c = _signal.connect (_signal.connect (boost::bind (&compositor, slot, event_loop, _1, _2, _3))); + c = _signal.connect (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2, _3))); } typename SignalType::result_type operator()(A1 arg1, A2 arg2, A3 arg3) { @@ -252,20 +264,24 @@ public: c = _signal.connect (slot); } - static void compositor (typename boost::function<void(A1,A2,A3)> f, PBD::EventLoop* event_loop, A1 arg1, A2 arg2, A3 arg3, A4 arg4) { - event_loop->call_slot (boost::bind (f, arg1, arg2, arg3, arg4)); + static void compositor (typename boost::function<void(A1,A2,A3)> f, PBD::EventLoop* event_loop, + EventLoop::InvalidationRecord* ir, + A1 arg1, A2 arg2, A3 arg3, A4 arg4) { + event_loop->call_slot (ir, boost::bind (f, arg1, arg2, arg3, arg4)); } void connect (ScopedConnectionList& clist, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, _1, _2, _3, _4))); + clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2, _3, _4))); } void connect (Connection& c, + PBD::EventLoop::InvalidationRecord* ir, const typename SignalType::slot_function_type& slot, PBD::EventLoop* event_loop) { - c = _signal.connect (_signal.connect (boost::bind (&compositor, slot, event_loop, _1, _2, _3, _4))); + c = _signal.connect (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2, _3, _4))); } typename SignalType::result_type operator()(A1 arg1, A2 arg2, A3 arg3, A4 arg4) { |