Index: ui/gl/gl_image_shm.cc |
diff --git a/ui/gl/gl_image_shm.cc b/ui/gl/gl_image_shm.cc |
index 75ef453eade794fe846ed1548dbe90d7e56f6f3f..148d16405c8d1faceea93fffce9fc22f3a2ed271 100644 |
--- a/ui/gl/gl_image_shm.cc |
+++ b/ui/gl/gl_image_shm.cc |
@@ -6,6 +6,7 @@ |
#include "base/debug/trace_event.h" |
#include "base/process/process_handle.h" |
+#include "ui/gl/gl_context.h" |
#include "ui/gl/scoped_binders.h" |
#if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ |
@@ -112,8 +113,9 @@ void GLImageShm::Destroy() { |
eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_); |
egl_image_ = EGL_NO_IMAGE_KHR; |
} |
- |
- if (egl_texture_id_) { |
+ GLContext* current_context = GLContext::GetCurrent(); |
+ if (egl_texture_id_ && |
+ (current_context && current_context->IsCurrent(NULL))) { |
glDeleteTextures(1, &egl_texture_id_); |
egl_texture_id_ = 0u; |
} |
sohanjg
2014/05/28 10:16:00
Wouldnt we end up leaking the texture if current_c
no sievers
2014/05/28 18:55:32
I think we should rather pass through the flag fro
reveman
2014/05/28 20:23:33
I think the problem is that GLImages are ref count
no sievers
2014/05/28 21:02:39
Should a gpu::gles2::Texture also call ReleaseTexI
reveman
2014/05/28 21:14:56
I don't think it does but it seems like a good ide
|