summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2013-11-22 19:48:24 +0900
committerChunEon Park <hermet@hermet.pe.kr>2013-11-22 19:48:24 +0900
commitda3f93ef06cd78654c82470f3f852ea46d70e561 (patch)
treee856b8e1ae6345017d005bb536ef3ae1dfe6097a /src
parent60773cdf293abad562bd4d26731f40d1840750de (diff)
elementary/mapbuf - reset the mapbuf correctly when the content is removed(unset)
When the content is removed(or unset) the mapbuf didn't clean up the some stuff such as removing event callback for the content. So the unset content would be tracked still by mapbuf dangling callbacks.
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_mapbuf.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c
index 59c846022..7a574bc8e 100644
--- a/src/lib/elm_mapbuf.c
+++ b/src/lib/elm_mapbuf.c
@@ -56,6 +56,24 @@ _changed_size_hints_cb(void *data,
56} 56}
57 57
58static void 58static void
59_elm_mapbuf_content_unset(Elm_Mapbuf_Smart_Data *sd, Evas_Object *obj,
60 Evas_Object *content)
61{
62 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
63
64 evas_object_data_del(content, "_elm_leaveme");
65 evas_object_smart_member_del(content);
66 evas_object_clip_unset(content);
67 evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
68 evas_object_event_callback_del_full
69 (content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb,
70 obj);
71 sd->content = NULL;
72 _sizing_eval(obj);
73 ELM_SAFE_FREE(sd->idler, ecore_idler_del);
74}
75
76static void
59_elm_mapbuf_smart_sub_object_del(Eo *obj, void *_pd, va_list *list) 77_elm_mapbuf_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
60{ 78{
61 Elm_Mapbuf_Smart_Data *sd = _pd; 79 Elm_Mapbuf_Smart_Data *sd = _pd;
@@ -68,17 +86,7 @@ _elm_mapbuf_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
68 if (!int_ret) return; 86 if (!int_ret) return;
69 87
70 if (sobj == sd->content) 88 if (sobj == sd->content)
71 { 89 _elm_mapbuf_content_unset(sd, (Evas_Object *)obj, sobj);
72 evas_object_data_del(sobj, "_elm_leaveme");
73 evas_object_smart_member_del(sobj);
74 evas_object_clip_unset(sobj);
75 evas_object_event_callback_del_full
76 (sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb,
77 obj);
78 sd->content = NULL;
79 _sizing_eval(obj);
80 }
81
82 if (ret) *ret = EINA_TRUE; 90 if (ret) *ret = EINA_TRUE;
83} 91}
84 92
@@ -249,19 +257,14 @@ _elm_mapbuf_smart_content_unset(Eo *obj, void *_pd, va_list *list)
249 if (ret) *ret = NULL; 257 if (ret) *ret = NULL;
250 258
251 Elm_Mapbuf_Smart_Data *sd = _pd; 259 Elm_Mapbuf_Smart_Data *sd = _pd;
252 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
253 260
254 if (part && strcmp(part, "default")) return; 261 if (part && strcmp(part, "default")) return;
255 if (!sd->content) return; 262 if (!sd->content) return;
256 263
257 content = sd->content; 264 content = sd->content;
258 elm_widget_sub_object_del(obj, content); 265 elm_widget_sub_object_del(obj, content);
259 evas_object_smart_member_del(content); 266 _elm_mapbuf_content_unset(sd, obj, content);
260 evas_object_data_del(content, "_elm_leaveme");
261 evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
262 sd->content = NULL;
263 if (ret) *ret = content; 267 if (ret) *ret = content;
264 ELM_SAFE_FREE(sd->idler, ecore_idler_del);
265} 268}
266 269
267static void 270static void