From cf9b54e5ab231d99d31a66e0b564b157f038c38a Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 24 Jul 2013 16:53:40 +0200 Subject: [PATCH] Properly deleting data (delete vs. delete[]). --- library/PolyVoxCore/include/PolyVoxCore/Impl/Block.inl | 2 +- library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Block.inl b/library/PolyVoxCore/include/PolyVoxCore/Impl/Block.inl index dab2f35d..16927b4e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Block.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Block.inl @@ -111,7 +111,7 @@ namespace PolyVox template UncompressedBlock::~UncompressedBlock() { - delete m_tData; + delete[] m_tData; m_tData = 0; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 10069d49..ad67d849 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -659,6 +659,8 @@ namespace PolyVox } } + delete itUncompressedBlock->second; + // We can now remove the block data from memory. m_pUncompressedBlockCache.erase(itUncompressedBlock); }