mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-31 09:57:14 +01:00
Fix bug in signal implementation which did not update the number of remaining slots after removing some.
This commit is contained in:
parent
5511a4f690
commit
35a24e12eb
@ -876,7 +876,7 @@ SQInteger Signal::Eliminate(SignalWrapper & w)
|
||||
// Backup the current number of used slots
|
||||
const SizeType count = m_Used;
|
||||
// Forward the call to the actual function
|
||||
RemoveIf(MatchSlot< Slot >(w.mSlot.mThisHash, w.mSlot.mFuncHash),
|
||||
m_Used -= RemoveIf(MatchSlot< Slot >(w.mSlot.mThisHash, w.mSlot.mFuncHash),
|
||||
m_Slots, m_Slots + m_Used, m_Scope);
|
||||
// Push the number of removed slots
|
||||
sq_pushinteger(w.mVM, static_cast< SQInteger >(count - m_Used));
|
||||
@ -899,7 +899,7 @@ SQInteger Signal::EliminateThis(SignalWrapper & w)
|
||||
// Backup the current number of used slots
|
||||
const SizeType count = m_Used;
|
||||
// Forward the call to the actual function
|
||||
RemoveIf(MatchThis< Slot >(w.mSlot.mThisHash), m_Slots, m_Slots + m_Used, m_Scope);
|
||||
m_Used -= RemoveIf(MatchThis< Slot >(w.mSlot.mThisHash), m_Slots, m_Slots + m_Used, m_Scope);
|
||||
// Push the number of removed slots
|
||||
sq_pushinteger(w.mVM, static_cast< SQInteger >(count - m_Used));
|
||||
}
|
||||
@ -921,7 +921,7 @@ SQInteger Signal::EliminateFunc(SignalWrapper & w)
|
||||
// Backup the current number of used slots
|
||||
const SizeType count = m_Used;
|
||||
// Forward the call to the actual function
|
||||
RemoveIf(MatchFunc< Slot >(w.mSlot.mFuncHash), m_Slots, m_Slots + m_Used, m_Scope);
|
||||
m_Used -= RemoveIf(MatchFunc< Slot >(w.mSlot.mFuncHash), m_Slots, m_Slots + m_Used, m_Scope);
|
||||
// Push the number of removed slots
|
||||
sq_pushinteger(w.mVM, static_cast< SQInteger >(count - m_Used));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user