summaryrefslogtreecommitdiffstats
path: root/source/ItemGrid.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-13 09:36:43 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-13 09:36:43 +0200
commit03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43 (patch)
tree8027076867da60f62e52362059717c94084bcfd9 /source/ItemGrid.cpp
parentProtectionAreas: Added proper ignored files (diff)
downloadcuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.tar
cuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.tar.gz
cuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.tar.bz2
cuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.tar.lz
cuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.tar.xz
cuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.tar.zst
cuberite-03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43.zip
Diffstat (limited to 'source/ItemGrid.cpp')
-rw-r--r--source/ItemGrid.cpp10
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[]