Revert "evas - clip shutdown fix to avoid invalid mem accesses"
authorCedric Bail <cedric.bail@samsung.com>
Mon, 4 Nov 2013 03:23:25 +0000 (12:23 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Mon, 4 Nov 2013 03:23:25 +0000 (12:23 +0900)
This reverts commit eb6af1f1ff7ee069eff8bab13c0eed5010ef5660.

This commit was making the code much more complex than required. Let's make
eina_cow_free set the value back to its default.

src/lib/evas/canvas/evas_clip.c
src/lib/evas/canvas/evas_object_main.c

index 5dfbc48..76cddc0 100644 (file)
@@ -369,7 +369,6 @@ _clip_unset(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
 {
    Evas_Object_Protected_Data *obj = _pd;
 
-   if (!obj->cur) return;
    if (!obj->cur->clipper) return;
 
    obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer);
@@ -387,7 +386,7 @@ _clip_unset(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
           {
              EINA_COW_STATE_WRITE_BEGIN(obj->cur->clipper, state_write, cur)
                {
-                  if (state_write) state_write->have_clipees = 0;
+                  state_write->have_clipees = 0;
                }
              EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
 
@@ -418,17 +417,14 @@ _clip_unset(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
    if ((!obj->is_smart) &&
        (!((obj->map->cur.map) && (obj->map->cur.usemap))))
      {
-        if (obj->cur)
-          {
-             if (evas_object_is_in_output_rect(eo_obj, obj,
-                                               obj->layer->evas->pointer.x,
-                                               obj->layer->evas->pointer.y, 1, 1))
-               evas_event_feed_mouse_move(obj->layer->evas->evas,
+        if (evas_object_is_in_output_rect(eo_obj, obj,
                                           obj->layer->evas->pointer.x,
-                                          obj->layer->evas->pointer.y,
-                                          obj->layer->evas->last_timestamp,
-                                          NULL);
-          }
+                                          obj->layer->evas->pointer.y, 1, 1))
+          evas_event_feed_mouse_move(obj->layer->evas->evas,
+                                     obj->layer->evas->pointer.x,
+                                     obj->layer->evas->pointer.y,
+                                     obj->layer->evas->last_timestamp,
+                                     NULL);
      }
    evas_object_clip_across_check(eo_obj, obj);
 }
index c779f2d..27fc7ad 100644 (file)
@@ -141,7 +141,6 @@ void
 evas_object_free(Evas_Object *eo_obj, int clean_layer)
 {
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, MY_CLASS);
-   Evas_Object *eo_obj2;
    if (!obj) return;
    obj->clean_layer = clean_layer;
 
@@ -172,21 +171,8 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
         obj->func->free(eo_obj, obj, obj->private_data);
      }
    if (!was_smart_child) evas_object_release(eo_obj, obj, obj->clean_layer);
-   EINA_LIST_FREE(obj->clip.clipees, eo_obj2)
-     {
-        Evas_Object_Protected_Data *obj2 = 
-          eo_data_scope_get(eo_obj2, MY_CLASS);
-        if ((obj2) && (obj2->cur))
-          {
-             EINA_COW_STATE_WRITE_BEGIN(obj2, state_write, cur)
-               {
-                  state_write->clipper = NULL;
-               }
-             EINA_COW_STATE_WRITE_END(obj2, state_write, cur);
-          }
-     }
-//   if (obj->clip.clipees)
-//     obj->clip.clipees = eina_list_free(obj->clip.clipees);
+   if (obj->clip.clipees)
+     eina_list_free(obj->clip.clipees);
    obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer);
    evas_object_clip_changes_clean(eo_obj);
    evas_object_event_callback_all_del(eo_obj);
@@ -202,17 +188,12 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
      }
    if (obj->size_hints)
      {
-        EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
-        obj->size_hints = NULL;
+       EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
      }
    eina_cow_free(evas_object_proxy_cow, obj->proxy);
    eina_cow_free(evas_object_map_cow, obj->map);
    eina_cow_free(evas_object_state_cow, obj->cur);
    eina_cow_free(evas_object_state_cow, obj->prev);
-   obj->cur = NULL;
-   obj->prev = NULL;
-   obj->map = NULL;
-   obj->proxy = NULL;
    eo_data_unref(eo_obj, obj->private_data);
    obj->private_data = NULL;
    eo_manual_free(eo_obj);