try this one
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 28 Jul 2010 08:11:30 +0000 (08:11 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 28 Jul 2010 08:11:30 +0000 (08:11 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@50589 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/gl_x11/evas_engine.c

index 9de25ae..b568035 100644 (file)
@@ -325,8 +325,15 @@ eng_setup(Evas *e, void *in)
             (info->info.destination_alpha != re->win->alpha) ||
             (info->info.rotation != re->win->rot))
           {
-             Evas_GL_X11_Window *oldwin = re->win;
+             int inc = 0;
              
+             if (re->win)
+               {
+                  re->win->gl_context->shared->references++;
+                  eng_window_free(re->win);
+                  inc = 1;
+                  gl_wins--;
+               }
              re->win = eng_window_new(info->info.display,
                                       info->info.drawable,
                                       info->info.screen,
@@ -339,11 +346,8 @@ eng_setup(Evas *e, void *in)
                                       info->info.destination_alpha,
                                       info->info.rotation);
              if (re->win) gl_wins++;
-             if (oldwin)
-               {
-                  eng_window_free(oldwin);
-                  gl_wins--;
-               }
+             if ((re->win) && (inc))
+                re->win->gl_context->shared->references--;
           }
         else if ((re->win->w != e->output.w) ||
                  (re->win->h != e->output.h))