summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-10-19 17:54:20 +0200
committerDavid 'Digit' Turner <digit@google.com>2011-10-19 17:54:20 +0200
commit0e205e6d6e8a032683597a0a1293925b7b9e462d (patch)
treebd0bcb2a7f4c61b2715215ecee329373b3fafbab /tools
parent207118ad6d68338af0fbf75df29e15cbf5c794d5 (diff)
downloadandroid_development-0e205e6d6e8a032683597a0a1293925b7b9e462d.tar.gz
android_development-0e205e6d6e8a032683597a0a1293925b7b9e462d.tar.bz2
android_development-0e205e6d6e8a032683597a0a1293925b7b9e462d.zip
emulator: opengl: minor fix and reformatting
This patches fixes a minor invalid usage of delete (instead of delete[]) and reformats the source code a little to make it more obvious. Change-Id: If853d12e74549abcc6682430c837b0f14da81fdc
Diffstat (limited to 'tools')
-rw-r--r--tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h11
-rw-r--r--tools/emulator/opengl/system/OpenglSystemCommon/HostConnection.cpp2
-rw-r--r--tools/emulator/opengl/system/egl/egl.cpp6
3 files changed, 13 insertions, 6 deletions
diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h b/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h
index 1a18f473f..30b9a80ee 100644
--- a/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h
+++ b/tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h
@@ -25,18 +25,21 @@ public:
}
~FixedBuffer() {
- delete m_buffer;
+ delete [] m_buffer;
m_bufferLen = 0;
}
void * alloc(size_t size) {
- if (m_bufferLen >= size) return (void *)(m_buffer);
+ 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];
- if (m_buffer == NULL) m_bufferLen = 0;
+ if (m_buffer == NULL)
+ m_bufferLen = 0;
return m_buffer;
}
diff --git a/tools/emulator/opengl/system/OpenglSystemCommon/HostConnection.cpp b/tools/emulator/opengl/system/OpenglSystemCommon/HostConnection.cpp
index 29273416c..3355d9f1e 100644
--- a/tools/emulator/opengl/system/OpenglSystemCommon/HostConnection.cpp
+++ b/tools/emulator/opengl/system/OpenglSystemCommon/HostConnection.cpp
@@ -69,6 +69,7 @@ HostConnection *HostConnection::get()
}
if (stream->connect() < 0) {
LOGE("Failed to connect to host (QemuPipeStream)!!!\n");
+ delete stream;
delete con;
return NULL;
}
@@ -85,6 +86,7 @@ HostConnection *HostConnection::get()
if (stream->connect("10.0.2.2", STREAM_PORT_NUM) < 0) {
LOGE("Failed to connect to host (TcpStream)!!!\n");
+ delete stream;
delete con;
return NULL;
}
diff --git a/tools/emulator/opengl/system/egl/egl.cpp b/tools/emulator/opengl/system/egl/egl.cpp
index e9bae3ae3..37a9becde 100644
--- a/tools/emulator/opengl/system/egl/egl.cpp
+++ b/tools/emulator/opengl/system/egl/egl.cpp
@@ -146,8 +146,10 @@ EGLContext_t::EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* share
flags = 0;
version = 1;
clientState = new GLClientState();
- if (shareCtx) sharedGroup = shareCtx->getSharedGroup();
- else sharedGroup = GLSharedGroupPtr(new GLSharedGroup());
+ if (shareCtx)
+ sharedGroup = shareCtx->getSharedGroup();
+ else
+ sharedGroup = GLSharedGroupPtr(new GLSharedGroup());
};
EGLContext_t::~EGLContext_t()