From 9648c1a2b9b527bcef64bb9d96e8385a14949840 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 3 Jun 2009 19:00:53 -0700 Subject: make sure clear the draw and read EGLSurface when eglMakeCurrent() is called for unbinding from the thread --- opengl/libagl/egl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'opengl/libagl/egl.cpp') diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index f50257abb7..0df2bbaa58 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -384,7 +384,7 @@ void egl_window_surface_v2_t::connect() void egl_window_surface_v2_t::disconnect() { - if (buffer) { + if (buffer && bits) { bits = NULL; unlock(buffer); } @@ -1681,10 +1681,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, egl_surface_t* d = (egl_surface_t*)c->draw; egl_surface_t* r = (egl_surface_t*)c->read; if (d) { + c->draw = 0; d->ctx = EGL_NO_CONTEXT; d->disconnect(); } if (r) { + c->read = 0; r->ctx = EGL_NO_CONTEXT; // FIXME: unlock/disconnect the read surface too } -- cgit v1.2.3-59-g8ed1b