diff options
author | Mattes D <github@xoft.cz> | 2014-06-19 11:03:40 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-06-19 11:03:40 +0200 |
commit | 4c7545a82ad8f086c66de7a7cfb26ba1800780fa (patch) | |
tree | d6a37e6433f973765c8ca63e408dbbd420b08d70 /src/Items | |
parent | Merge pull request #1096 from mc-server/redstonerefactor (diff) | |
parent | Nullify deleted pointers. (diff) | |
download | cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.tar cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.tar.gz cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.tar.bz2 cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.tar.lz cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.tar.xz cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.tar.zst cuberite-4c7545a82ad8f086c66de7a7cfb26ba1800780fa.zip |
Diffstat (limited to 'src/Items')
-rw-r--r-- | src/Items/ItemBow.h | 1 | ||||
-rw-r--r-- | src/Items/ItemHandler.cpp | 1 | ||||
-rw-r--r-- | src/Items/ItemItemFrame.h | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index e0ab339d3..821e2ab26 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -69,6 +69,7 @@ public: if (!Arrow->Initialize(*a_Player->GetWorld())) { delete Arrow; + Arrow = NULL; return; } a_Player->GetWorld()->BroadcastSpawnEntity(*Arrow); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index d97f986ba..f639423ae 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -260,6 +260,7 @@ void cItemHandler::Deinit() for(int i = 0; i < 2267; i++) { delete m_ItemHandler[i]; + m_ItemHandler[i] = NULL; } memset(m_ItemHandler, 0, sizeof(m_ItemHandler)); // Don't leave any dangling pointers around, just in case m_HandlerInitialized = false; diff --git a/src/Items/ItemItemFrame.h b/src/Items/ItemItemFrame.h index 097f04d0b..b258b4aea 100644 --- a/src/Items/ItemItemFrame.h +++ b/src/Items/ItemItemFrame.h @@ -37,6 +37,7 @@ public: if (!ItemFrame->Initialize(*a_World)) { delete ItemFrame; + ItemFrame = NULL; return false; } |