summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_dayselector.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-07 15:16:29 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:19 -0700
commit0fe3b7962d2558b17fe5bb6f0f2b00737bd63dee (patch)
treea50df2ff22d964afc7c59f45031035897c550d28 /src/lib/elementary/elm_dayselector.c
parent0239099d01921edb6a9dec7c7e1b0e3562ca11b8 (diff)
elementary: due to lifecycle difference between legacy object and unified object, we need to track their lifecycle more explicitely.
It is my understanding that some items view are created with efl_add directly and manipulate VIEW directly with Eo new API. This clash with the inconsistent behavior that evas_object_del expect. To work around this, we track object life by explictely relying on efl_wref_add while holding the pointer to the object.
Diffstat (limited to 'src/lib/elementary/elm_dayselector.c')
-rw-r--r--src/lib/elementary/elm_dayselector.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c
index 8efbfd8..6816ca7 100644
--- a/src/lib/elementary/elm_dayselector.c
+++ b/src/lib/elementary/elm_dayselector.c
@@ -174,8 +174,7 @@ _item_del_cb(void *data,
174 _item_location_get(sd, it)); 174 _item_location_get(sd, it));
175 elm_layout_signal_emit(obj, buf, "elm"); 175 elm_layout_signal_emit(obj, buf, "elm");
176 176
177 VIEW(it) = NULL; 177 // The object is already being deleted, there is no point in calling efl_del on it nore setting it to NULL.
178 // The object is already being deleted, there is no point in calling efl_del on it.
179 178
180 elm_layout_sizing_eval(obj); 179 elm_layout_sizing_eval(obj);
181 break; 180 break;
@@ -243,7 +242,7 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
243 if (!content) return EINA_TRUE; /* item deletion already handled */ 242 if (!content) return EINA_TRUE; /* item deletion already handled */
244 243
245 evas_object_del(VIEW(it)); 244 evas_object_del(VIEW(it));
246 VIEW(it) = content; 245 VIEW_SET(it, content);
247 } 246 }
248 else 247 else
249 { 248 {
@@ -261,7 +260,7 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
261 } 260 }
262 261
263 sd->items = eina_list_append(sd->items, it); 262 sd->items = eina_list_append(sd->items, it);
264 VIEW(it) = content; 263 VIEW_SET(it, content);
265 } 264 }
266 265
267 snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it)); 266 snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
@@ -329,7 +328,6 @@ _elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *it
329 snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it)); 328 snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it));
330 elm_layout_signal_emit(obj, buf, "elm"); 329 elm_layout_signal_emit(obj, buf, "elm");
331 330
332 VIEW(it) = NULL;
333 efl_del(EO_OBJ(it)); 331 efl_del(EO_OBJ(it));
334 332
335 elm_layout_sizing_eval(obj); 333 elm_layout_sizing_eval(obj);