summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-03 21:43:11 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-03 21:43:11 +0900
commiteb6af1f1ff7ee069eff8bab13c0eed5010ef5660 (patch)
tree4f747c2868dbdc40d2a41f21589fe505ea8581d7 /src/lib/evas/canvas/evas_object_main.c
parent9337af1187451414dfc4d170b603efef9a3cad6a (diff)
evas - clip shutdown fix to avoid invalid mem accesses
many valgrind complaints on e shutdown are there regarding accessing cow sections, lists and object elements during shutdown. this plugs theses little holes to avoid the invalid accesses and thus avoids potential crashes.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_object_main.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 27fc7adfe4..c779f2d97a 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -141,6 +141,7 @@ void
141evas_object_free(Evas_Object *eo_obj, int clean_layer) 141evas_object_free(Evas_Object *eo_obj, int clean_layer)
142{ 142{
143 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, MY_CLASS); 143 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, MY_CLASS);
144 Evas_Object *eo_obj2;
144 if (!obj) return; 145 if (!obj) return;
145 obj->clean_layer = clean_layer; 146 obj->clean_layer = clean_layer;
146 147
@@ -171,8 +172,21 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
171 obj->func->free(eo_obj, obj, obj->private_data); 172 obj->func->free(eo_obj, obj, obj->private_data);
172 } 173 }
173 if (!was_smart_child) evas_object_release(eo_obj, obj, obj->clean_layer); 174 if (!was_smart_child) evas_object_release(eo_obj, obj, obj->clean_layer);
174 if (obj->clip.clipees) 175 EINA_LIST_FREE(obj->clip.clipees, eo_obj2)
175 eina_list_free(obj->clip.clipees); 176 {
177 Evas_Object_Protected_Data *obj2 =
178 eo_data_scope_get(eo_obj2, MY_CLASS);
179 if ((obj2) && (obj2->cur))
180 {
181 EINA_COW_STATE_WRITE_BEGIN(obj2, state_write, cur)
182 {
183 state_write->clipper = NULL;
184 }
185 EINA_COW_STATE_WRITE_END(obj2, state_write, cur);
186 }
187 }
188// if (obj->clip.clipees)
189// obj->clip.clipees = eina_list_free(obj->clip.clipees);
176 obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer); 190 obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer);
177 evas_object_clip_changes_clean(eo_obj); 191 evas_object_clip_changes_clean(eo_obj);
178 evas_object_event_callback_all_del(eo_obj); 192 evas_object_event_callback_all_del(eo_obj);
@@ -188,12 +202,17 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
188 } 202 }
189 if (obj->size_hints) 203 if (obj->size_hints)
190 { 204 {
191 EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints); 205 EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
206 obj->size_hints = NULL;
192 } 207 }
193 eina_cow_free(evas_object_proxy_cow, obj->proxy); 208 eina_cow_free(evas_object_proxy_cow, obj->proxy);
194 eina_cow_free(evas_object_map_cow, obj->map); 209 eina_cow_free(evas_object_map_cow, obj->map);
195 eina_cow_free(evas_object_state_cow, obj->cur); 210 eina_cow_free(evas_object_state_cow, obj->cur);
196 eina_cow_free(evas_object_state_cow, obj->prev); 211 eina_cow_free(evas_object_state_cow, obj->prev);
212 obj->cur = NULL;
213 obj->prev = NULL;
214 obj->map = NULL;
215 obj->proxy = NULL;
197 eo_data_unref(eo_obj, obj->private_data); 216 eo_data_unref(eo_obj, obj->private_data);
198 obj->private_data = NULL; 217 obj->private_data = NULL;
199 eo_manual_free(eo_obj); 218 eo_manual_free(eo_obj);