diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-21 23:14:23 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-21 23:14:23 +0200 |
commit | 7615ed90c020b88db52b0b094f00cd028e326b5a (patch) | |
tree | ca7f647e77195a6346a2333f3d9fe5292cd2ed40 /src/World.cpp | |
parent | Fixed invalid iterators (diff) | |
parent | Merge branch 'master' of https://github.com/mc-server/MCServer (diff) | |
download | cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.tar cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.tar.gz cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.tar.bz2 cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.tar.lz cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.tar.xz cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.tar.zst cuberite-7615ed90c020b88db52b0b094f00cd028e326b5a.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/World.cpp b/src/World.cpp index c9199b6ba..4c57b283f 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -273,12 +273,12 @@ cWorld::cWorld(const AString & a_WorldName, eDimension a_Dimension, const AStrin cWorld::~cWorld() { - delete m_SimulatorManager; - delete m_SandSimulator; - delete m_WaterSimulator; - delete m_LavaSimulator; - delete m_FireSimulator; - delete m_RedstoneSimulator; + delete m_SimulatorManager; m_SimulatorManager = NULL; + delete m_SandSimulator; m_SandSimulator = NULL; + delete m_WaterSimulator; m_WaterSimulator = NULL; + delete m_LavaSimulator; m_LavaSimulator = NULL; + delete m_FireSimulator; m_FireSimulator = NULL; + delete m_RedstoneSimulator; m_RedstoneSimulator = NULL; UnloadUnusedChunks(); @@ -3036,11 +3036,13 @@ int cWorld::SpawnMobFinalize(cMonster * a_Monster) if (cPluginManager::Get()->CallHookSpawningMonster(*this, *a_Monster)) { delete a_Monster; + a_Monster = NULL; return -1; } if (!a_Monster->Initialize(*this)) { delete a_Monster; + a_Monster = NULL; return -1; } BroadcastSpawnEntity(*a_Monster); @@ -3063,6 +3065,7 @@ int cWorld::CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProje if (!Projectile->Initialize(*this)) { delete Projectile; + Projectile = NULL; return -1; } return Projectile->GetUniqueID(); |