summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/utils/VectorImpl.cpp5
-rw-r--r--opengl/libs/GLES2/gl2.cpp2
-rw-r--r--opengl/libs/GLES_CM/gl.cpp2
3 files changed, 6 insertions, 3 deletions
diff --git a/libs/utils/VectorImpl.cpp b/libs/utils/VectorImpl.cpp
index 2c2d6675c2..0322af7da7 100644
--- a/libs/utils/VectorImpl.cpp
+++ b/libs/utils/VectorImpl.cpp
@@ -173,9 +173,10 @@ status_t VectorImpl::sort(VectorImpl::compar_r_t cmp, void* state)
if (!array) return NO_MEMORY;
temp = malloc(mItemSize);
if (!temp) return NO_MEMORY;
- _do_construct(temp, 1);
item = reinterpret_cast<char*>(array) + mItemSize*(i);
curr = reinterpret_cast<char*>(array) + mItemSize*(i-1);
+ } else {
+ _do_destroy(temp, 1);
}
_do_copy(temp, item, 1);
@@ -183,12 +184,14 @@ status_t VectorImpl::sort(VectorImpl::compar_r_t cmp, void* state)
ssize_t j = i-1;
void* next = reinterpret_cast<char*>(array) + mItemSize*(i);
do {
+ _do_destroy(next, 1);
_do_copy(next, curr, 1);
next = curr;
--j;
curr = reinterpret_cast<char*>(array) + mItemSize*(j);
} while (j>=0 && (cmp(curr, temp, state) > 0));
+ _do_destroy(next, 1);
_do_copy(next, temp, 1);
}
i++;
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index b8e328316a..924737e697 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -114,6 +114,6 @@ void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
{
GLeglImageOES implImage =
(GLeglImageOES)egl_get_image_for_current_context((EGLImageKHR)image);
- __glEGLImageTargetRenderbufferStorageOES(target, image);
+ __glEGLImageTargetRenderbufferStorageOES(target, implImage);
}
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
index e7757a8fea..d71ff76209 100644
--- a/opengl/libs/GLES_CM/gl.cpp
+++ b/opengl/libs/GLES_CM/gl.cpp
@@ -185,6 +185,6 @@ void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
{
GLeglImageOES implImage =
(GLeglImageOES)egl_get_image_for_current_context((EGLImageKHR)image);
- __glEGLImageTargetRenderbufferStorageOES(target, image);
+ __glEGLImageTargetRenderbufferStorageOES(target, implImage);
}