aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorJim Ramsay <i.am@jimramsay.com>2010-07-14 15:36:00 (GMT)
committerJim Ramsay <i.am@jimramsay.com>2010-07-14 15:36:00 (GMT)
commita3b063292c003a32c72859f3eecc92de6e1dd132 (patch)
treefee8d5fe84771d328e35087a8b183d123895801b /src/FbTk
parent3578d1474180ea151adf20ca745aa4ce3f4b3059 (diff)
downloadfluxbox-a3b063292c003a32c72859f3eecc92de6e1dd132.zip
fluxbox-a3b063292c003a32c72859f3eecc92de6e1dd132.tar.bz2
bugfix: another crash when cleaning up signals
While 769130f51a8f did fix one issue, it introduced another by changing the logic related to the new SignalTracker. The original logic (introduced in 9ad388c5bf16) was: -> in 'leave(Signal)', only call 'disconnect' -> in 'leaveAll()', call 'disconnect' and 'disconnectTracker' But 769130f51a8f inverted this, calling 'disconnectTracker' in both cases but only 'disconnect' in the 'leaveAll()' case, which would leave unattached signals around after calling 'leave(Signal)'. This fix not only repairs the logic, but renames the ambiguous 'disconnect' boolean to something more explicit: 'withTracker'.
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Signal.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/Signal.hh b/src/FbTk/Signal.hh
index b70c501..3c17d1a 100644
--- a/src/FbTk/Signal.hh
+++ b/src/FbTk/Signal.hh
@@ -242,14 +242,14 @@ public:
242 242
243 /// Leave tracking for a signal 243 /// Leave tracking for a signal
244 /// @param id the \c id from the previous \c join 244 /// @param id the \c id from the previous \c join
245 void leave(TrackID id, bool disconnect = false) { 245 void leave(TrackID id, bool withTracker = false) {
246 // keep temporary, while disconnecting we can 246 // keep temporary, while disconnecting we can
247 // in some strange cases get a call to this again 247 // in some strange cases get a call to this again
248 ValueType tmp = *id; 248 ValueType tmp = *id;
249 m_connections.erase(id); 249 m_connections.erase(id);
250 if (disconnect) 250 tmp.first->disconnect(tmp.second);
251 tmp.first->disconnect(tmp.second); 251 if (withTracker)
252 tmp.first->disconnectTracker(*this); 252 tmp.first->disconnectTracker(*this);
253 } 253 }
254 254
255 /// Leave tracking for a signal 255 /// Leave tracking for a signal