summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-21 23:14:23 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-21 23:14:23 +0200
commit7615ed90c020b88db52b0b094f00cd028e326b5a (patch)
treeca7f647e77195a6346a2333f3d9fe5292cd2ed40 /src/World.cpp
parentFixed invalid iterators (diff)
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
downloadcuberite-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.cpp15
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();