summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-19 10:49:56 +0200
committerarchshift <admin@archshift.com>2014-06-19 10:49:56 +0200
commite8143de01bff31f9e153949d7ab5b0df82629541 (patch)
treed6a37e6433f973765c8ca63e408dbbd420b08d70 /src/World.cpp
parentMerge pull request #1096 from mc-server/redstonerefactor (diff)
downloadcuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.gz
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.bz2
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.lz
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.xz
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.zst
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 6bcd1391a..5b067b386 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -267,12 +267,12 @@ cWorld::cWorld(const AString & a_WorldName) :
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();
@@ -2972,11 +2972,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);
@@ -2999,6 +3001,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();