From 7ba89ec5a70f753dde898d352b99313462767548 Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 29 Jul 2010 06:21:51 +0000 Subject: [PATCH] now work? git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@50635 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/gl_x11/evas_engine.c | 4 ++-- src/modules/engines/gl_x11/evas_x_main.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c index dcb4d49..5ca45f3 100644 --- a/src/modules/engines/gl_x11/evas_engine.c +++ b/src/modules/engines/gl_x11/evas_engine.c @@ -330,7 +330,7 @@ eng_setup(Evas *e, void *in) if (re->win) { - re->win->gl_context->shared->references++; + re->win->gl_context->references++; eng_window_free(re->win); inc = 1; gl_wins--; @@ -348,7 +348,7 @@ eng_setup(Evas *e, void *in) info->info.rotation); if (re->win) gl_wins++; if ((re->win) && (inc)) - re->win->gl_context->shared->references--; + re->win->gl_context->references--; } else if ((re->win->w != e->output.w) || (re->win->h != e->output.h)) diff --git a/src/modules/engines/gl_x11/evas_x_main.c b/src/modules/engines/gl_x11/evas_x_main.c index bd67a48..02cceb9 100644 --- a/src/modules/engines/gl_x11/evas_x_main.c +++ b/src/modules/engines/gl_x11/evas_x_main.c @@ -395,14 +395,19 @@ eng_window_new(Display *disp, void eng_window_free(Evas_GL_X11_Window *gw) { + int ref = 0; win_count--; eng_window_use(gw); if (gw == _evas_gl_x11_window) _evas_gl_x11_window = NULL; - if (gw->gl_context) evas_gl_common_context_free(gw->gl_context); + if (gw->gl_context) + { + ref = gw->gl_context->references; + evas_gl_common_context_free(gw->gl_context); + } #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) if (gw->egl_surface[0] != EGL_NO_SURFACE) eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); - if (win_count == 0) + if (ref == 0) { if (context) eglDestroyContext(gw->egl_disp, context); eglTerminate(gw->egl_disp); @@ -411,7 +416,7 @@ eng_window_free(Evas_GL_X11_Window *gw) eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); #else if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin); - if (win_count == 0) + if (ref == 0) { if (context) glXDestroyContext(gw->disp, context); if (rgba_context) glXDestroyContext(gw->disp, rgba_context); -- 2.7.4