aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Signal.hh19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/FbTk/Signal.hh b/src/FbTk/Signal.hh
index 06136ba..702f05e 100644
--- a/src/FbTk/Signal.hh
+++ b/src/FbTk/Signal.hh
@@ -117,7 +117,6 @@ public:
117 117
118 SlotID connect(const SlotType& slot) { 118 SlotID connect(const SlotType& slot) {
119 return SignalHolder::connect(slot); 119 return SignalHolder::connect(slot);
120
121 } 120 }
122}; 121};
123 122
@@ -243,8 +242,14 @@ public:
243 242
244 /// Leave tracking for a signal 243 /// Leave tracking for a signal
245 /// @param id the \c id from the previous \c join 244 /// @param id the \c id from the previous \c join
246 void leave(TrackID id) { 245 void leave(TrackID id, bool disconnect = false) {
246 // keep temporary, while disconnecting we can
247 // in some strange cases get a call to this again
248 ValueType tmp = *id;
247 m_connections.erase(id); 249 m_connections.erase(id);
250 if (disconnect)
251 tmp.first->disconnect(tmp.second);
252 tmp.first->disconnectTracker(*this);
248 } 253 }
249 254
250 /// Leave tracking for a signal 255 /// Leave tracking for a signal
@@ -253,8 +258,7 @@ public:
253 void leave(Signal &sig) { 258 void leave(Signal &sig) {
254 Iterator it = m_connections.find(&sig); 259 Iterator it = m_connections.find(&sig);
255 if (it != m_connections.end()) { 260 if (it != m_connections.end()) {
256 it->first->disconnect( it->second ); 261 leave(it);
257 m_connections.erase(it);
258 } 262 }
259 } 263 }
260 264
@@ -263,12 +267,7 @@ public:
263 // disconnect all connections 267 // disconnect all connections
264 for ( Iterator conIt = m_connections.begin(); 268 for ( Iterator conIt = m_connections.begin();
265 conIt != m_connections.end(); ++conIt) { 269 conIt != m_connections.end(); ++conIt) {
266 // keep temporary, while disconnecting we can 270 leave(conIt, true);
267 // in some strange cases get a call to this again
268 ValueType tmp = *conIt;
269 m_connections.erase(conIt);
270 tmp.first->disconnect(tmp.second);
271 tmp.first->disconnectTracker(*this);
272 } 271 }
273 } 272 }
274 273