bugfix: another crash when cleaning up signals
While769130f51a
did fix one issue, it introduced another by changing the logic related to the new SignalTracker. The original logic (introduced in9ad388c5bf
) was: -> in 'leave(Signal)', only call 'disconnect' -> in 'leaveAll()', call 'disconnect' and 'disconnectTracker' But769130f51a
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'.
This commit is contained in:
parent
3578d14741
commit
a3b063292c
1 changed files with 4 additions and 4 deletions
|
@ -242,14 +242,14 @@ public:
|
|||
|
||||
/// Leave tracking for a signal
|
||||
/// @param id the \c id from the previous \c join
|
||||
void leave(TrackID id, bool disconnect = false) {
|
||||
void leave(TrackID id, bool withTracker = false) {
|
||||
// keep temporary, while disconnecting we can
|
||||
// in some strange cases get a call to this again
|
||||
ValueType tmp = *id;
|
||||
m_connections.erase(id);
|
||||
if (disconnect)
|
||||
tmp.first->disconnect(tmp.second);
|
||||
tmp.first->disconnectTracker(*this);
|
||||
tmp.first->disconnect(tmp.second);
|
||||
if (withTracker)
|
||||
tmp.first->disconnectTracker(*this);
|
||||
}
|
||||
|
||||
/// Leave tracking for a signal
|
||||
|
|
Loading…
Reference in a new issue