Merge "opengles emulator: GLES fix memory leaks"

This commit is contained in:
David Turner
2011-08-10 01:58:48 -07:00
committed by Android Code Review
6 changed files with 7 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ EglConfig* pixelFormatToConfig(EGLNativeDisplayType dpy,int renderableType,EGLNa
int bSize,red,green,blue,alpha,depth,stencil;
int supportedSurfaces,visualType,visualId;
int caveat,transparentType,samples;
int tRed,tGreen,tBlue;
int tRed=0,tGreen=0,tBlue=0;
int pMaxWidth,pMaxHeight,pMaxPixels;
int tmp;
int configId,level,renderable;

View File

@@ -22,7 +22,7 @@ class EglDisplay;
class GLEScontext;
struct ThreadInfo {
ThreadInfo():glesContext(NULL),objManager(NULL){}
ThreadInfo():eglDisplay(NULL),glesContext(NULL),objManager(NULL){}
void updateInfo(ContextPtr eglctx,
EglDisplay* dpy,

View File

@@ -36,6 +36,7 @@ FramebufferData::FramebufferData(GLuint name):m_dirty(false) {
m_attachPoints[i].target = 0;
m_attachPoints[i].name = 0;
m_attachPoints[i].obj = ObjectDataPtr(NULL);
m_attachPoints[i].owned = false;
}
}

View File

@@ -97,7 +97,7 @@ void doCompressedTexImage2D(GLEScontext * ctx, GLenum target, GLint level,
glTexImage2DPtr(target,i,uncompressedFrmt,tmpWidth,tmpHeight,border,uncompressedFrmt,GL_UNSIGNED_BYTE,uncompressed);
tmpWidth/=2;
tmpHeight/=2;
delete uncompressed;
delete[] uncompressed;
}
}
break;

View File

@@ -183,7 +183,7 @@ InitConfigStatus FBConfig::initConfigList(FrameBuffer *fb)
}
s_numConfigs = j;
delete configs;
delete[] configs;
return ret;
}
@@ -303,6 +303,7 @@ FBConfig::FBConfig(EGLDisplay p_eglDpy, EGLConfig p_eglCfg)
m_eglConfig = p_eglCfg;
m_attribValues = new GLint[s_numConfigAttribs];
for (int i=0; i<s_numConfigAttribs; i++) {
m_attribValues[i] = 0;
s_egl.eglGetConfigAttrib(p_eglDpy, p_eglCfg, s_configAttribs[i], &m_attribValues[i]);
//

View File

@@ -36,7 +36,7 @@ ReadBuffer::~ReadBuffer()
int ReadBuffer::getData()
{
if ((m_validData > 0) && (m_readPtr > m_buf)) {
memcpy(m_buf, m_readPtr, m_validData);
memmove(m_buf, m_readPtr, m_validData);
}
// get fresh data into the buffer;
size_t len = m_size - m_validData;