Fixed memory leaks.

This commit is contained in:
David Williams 2011-09-08 21:29:23 +01:00
parent 0c97756a0c
commit df035d5237
4 changed files with 9 additions and 1 deletions

View File

@ -103,6 +103,7 @@ namespace PolyVox
LargeVolume<VoxelType>::~LargeVolume() LargeVolume<VoxelType>::~LargeVolume()
{ {
flushAll(); flushAll();
delete[] m_pUncompressedBorderData;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -49,6 +49,7 @@ namespace PolyVox
{ {
public: public:
Block(uint16_t uSideLength = 0); Block(uint16_t uSideLength = 0);
~Block();
uint16_t getSideLength(void) const; uint16_t getSideLength(void) const;
VoxelType getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const; VoxelType getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos) const;

View File

@ -71,7 +71,7 @@ namespace PolyVox
SimpleVolume<VoxelType>::~SimpleVolume() SimpleVolume<VoxelType>::~SimpleVolume()
{ {
delete[] m_pBlocks; delete[] m_pBlocks;
m_pBlocks = 0; delete[] m_pUncompressedBorderData;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -35,6 +35,12 @@ namespace PolyVox
} }
} }
template <typename VoxelType>
SimpleVolume<VoxelType>::Block::~Block()
{
delete[] m_tUncompressedData;
}
template <typename VoxelType> template <typename VoxelType>
uint16_t SimpleVolume<VoxelType>::Block::getSideLength(void) const uint16_t SimpleVolume<VoxelType>::Block::getSideLength(void) const
{ {