diff --git a/DepthBuffer.cpp b/DepthBuffer.cpp index 5c2e6b0f..69b3c557 100644 --- a/DepthBuffer.cpp +++ b/DepthBuffer.cpp @@ -204,10 +204,8 @@ void DepthBuffer::bindDepthImageTexture() #endif } -void DepthBufferList::init() +DepthBufferList::DepthBufferList() : m_pCurrent(NULL), m_pzLUT(NULL) { - m_pCurrent = NULL; - m_pzLUT = new u16[0x40000]; for (int i = 0; i<0x40000; i++) { u32 exponent = 0; @@ -222,10 +220,20 @@ void DepthBufferList::init() } } -void DepthBufferList::destroy() +DepthBufferList::~DepthBufferList() { delete[] m_pzLUT; m_pzLUT = NULL; + m_list.clear(); +} + +void DepthBufferList::init() +{ + m_pCurrent = NULL; +} + +void DepthBufferList::destroy() +{ m_pCurrent = NULL; m_list.clear(); } diff --git a/DepthBuffer.h b/DepthBuffer.h index b3431a26..246a0ef2 100644 --- a/DepthBuffer.h +++ b/DepthBuffer.h @@ -52,8 +52,9 @@ public: const u16 * const getZLUT() const {return m_pzLUT;} private: - DepthBufferList() : m_pCurrent(NULL), m_pzLUT(NULL) {} + DepthBufferList(); DepthBufferList(const FrameBufferList &); + ~DepthBufferList(); typedef std::list DepthBuffers; DepthBuffers m_list;