actually... do canvas free.
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 22 Mar 2010 05:33:46 +0000 (05:33 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 22 Mar 2010 05:33:46 +0000 (05:33 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@47362 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_callbacks.c
src/lib/canvas/evas_main.c
src/modules/engines/gl_common/evas_gl_context.c

index c67c67b..ab27ed4 100644 (file)
@@ -2,6 +2,7 @@
 #include "evas_private.h"
 
 static void evas_object_event_callback_clear(Evas_Object *obj);
+static void evas_event_callback_clear(Evas *e);
 int _evas_event_counter = 0;
 
 void
@@ -38,6 +39,20 @@ evas_object_event_callback_clear(Evas_Object *obj)
      }
 }
 
+static void
+evas_event_callback_clear(Evas *e)
+{
+   if (!e->callbacks) return;
+   if (!e->callbacks->deletions_waiting) return;
+   e->callbacks->deletions_waiting = 0;
+   evas_event_callback_list_post_free(&e->callbacks->callbacks);
+   if (!e->callbacks->callbacks)
+     {
+        free(e->callbacks);
+       e->callbacks = NULL;
+     }
+}
+
 void
 evas_object_event_callback_all_del(Evas_Object *obj)
 {
@@ -83,7 +98,10 @@ evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info)
           }
         e->callbacks->walking_list--;
         if (!e->callbacks->walking_list)
-          l_mod = NULL;
+          {
+            evas_event_callback_clear(e);
+             l_mod = NULL;
+          }
      }
    _evas_unwalk(e);
 }
@@ -644,6 +662,8 @@ evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func)
             data = fn->data;
             fn->delete_me = 1;
             e->callbacks->deletions_waiting = 1;
+            if (!e->callbacks->walking_list)
+              evas_event_callback_clear(e);
             return data;
          }
      }
@@ -699,6 +719,8 @@ evas_event_callback_del_full(Evas *e, Evas_Callback_Type type, Evas_Event_Cb fun
             data = fn->data;
             fn->delete_me = 1;
             e->callbacks->deletions_waiting = 1;
+            if (!e->callbacks->walking_list)
+              evas_event_callback_clear(e);
             return data;
          }
      }
index 00b692b..814f0a7 100644 (file)
@@ -181,11 +181,11 @@ evas_free(Evas *e)
    MAGIC_CHECK_END();
 
    if (e->walking_list == 0) evas_render_idle_flush(e);
-
-   if (e->walking_list > 0) return;
    
+   if (e->walking_list > 0) return;
    if (!e->callbacks) return;
-   if (!e->callbacks->deletions_waiting) return;
+   if (e->callbacks->deletions_waiting) return;
+   
    e->callbacks->deletions_waiting = 0;
    evas_event_callback_list_post_free(&e->callbacks->callbacks);
    if (!e->callbacks->callbacks)
index 1dd57a2..d5b5e76 100644 (file)
@@ -498,8 +498,11 @@ evas_gl_common_context_free(Evas_GL_Context *gc)
              for (j = 0; j < 3; j++)
                {
                   while (gc->shared->tex.atlas[i][j])
-                    evas_gl_common_texture_free
-                    ((Evas_GL_Texture *)gc->shared->tex.atlas[i][j]);
+                    {
+                       evas_gl_common_texture_free
+                         ((Evas_GL_Texture *)gc->shared->tex.atlas[i][j]);
+                       gc->shared->tex.atlas[i][j] = NULL;
+                    }
                }
           }
         free(gc->shared);