diff options
Diffstat (limited to 'source/ItemGrid.cpp')
-rw-r--r-- | source/ItemGrid.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/ItemGrid.cpp b/source/ItemGrid.cpp index c62ea6bcc..1154250f1 100644 --- a/source/ItemGrid.cpp +++ b/source/ItemGrid.cpp @@ -616,9 +616,13 @@ void cItemGrid::RemoveListener(cListener & a_Listener) void cItemGrid::TriggerListeners(int a_SlotNum)
{
- cCSLock Lock(m_CSListeners);
- m_IsInTriggerListeners = true;
- for (cListeners::iterator itr = m_Listeners.begin(), end = m_Listeners.end(); itr != end; ++itr)
+ cListeners Listeners;
+ {
+ cCSLock Lock(m_CSListeners);
+ m_IsInTriggerListeners = true;
+ Listeners = m_Listeners;
+ }
+ for (cListeners::iterator itr = Listeners.begin(), end = Listeners.end(); itr != end; ++itr)
{
(*itr)->OnSlotChanged(this, a_SlotNum);
} // for itr - m_Listeners[]
|