From 5018365268fb5baacc38ca6587904852d77fd4af Mon Sep 17 00:00:00 2001 From: Liran Date: Tue, 2 Aug 2011 17:58:04 +0300 Subject: [PATCH] opengles emulator: GLES memory leaks fix some memory leaks detected in valgrind Change-Id: I48d91223c520c9c10b797a89a679eed7a950a3e6 --- .../emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp | 6 +++--- .../emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp index 7c8edc0f6..dc8517c6c 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp +++ b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp @@ -261,7 +261,7 @@ int FBConfig::chooseConfig(FrameBuffer *fb, EGLint * attribs, uint32_t * configs s_egl.eglChooseConfig(dpy, newAttribs, matchedConfigs, nConfigs, &nConfigs); - delete newAttribs; + delete[] newAttribs; // // From all matchedConfigs we need only config_size FBConfigs, so we intersect both lists compating the CONFIG_ID attribute @@ -284,7 +284,7 @@ int FBConfig::chooseConfig(FrameBuffer *fb, EGLint * attribs, uint32_t * configs } } - delete matchedConfigs; + delete[] matchedConfigs; return nVerifiedCfgs; } @@ -308,6 +308,6 @@ FBConfig::FBConfig(EGLDisplay p_eglDpy, EGLConfig p_eglCfg) FBConfig::~FBConfig() { if (m_attribValues) { - delete m_attribValues; + delete[] m_attribValues; } } diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h b/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h index 7b8223d40..1a18f473f 100644 --- a/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h +++ b/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h @@ -32,7 +32,7 @@ public: void * alloc(size_t size) { if (m_bufferLen >= size) return (void *)(m_buffer); - if (m_buffer != NULL) delete m_buffer; + if (m_buffer != NULL) delete[] m_buffer; m_bufferLen = size; m_buffer = new unsigned char[m_bufferLen];