summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-03-01 16:22:08 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-03-01 17:10:43 -0800
commit0091e8b5b6269259185179542b85380838b1a546 (patch)
treebfdcfe30588d2b0b7f20d3320874e38b87e6f3b5 /src
parent89280385b40b51ba9df6e14ec4c5282c01308719 (diff)
elementary: Efl.Ui.Layout should use the new API efl_content to control object lifecycle property.
efl_content leave the caller in charge of the lifecycle of the object. This means we can rely on the factory to actually do something with the object before it is destroyed by anyone. Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D8091
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_layout.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 37f2b6fbb8..eea91fe1ca 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2002,7 +2002,7 @@ _efl_ui_layout_view_model_signal_update(Efl_Ui_Layout_Data *pd, const char *sign
2002 Eina_Error error; 2002 Eina_Error error;
2003 2003
2004 eina_value_get(v, &error); 2004 eina_value_get(v, &error);
2005 ERR("Failed to fetch signal value. Error: %s", eina_error_msg_get(error)); 2005 if (error != EAGAIN) ERR("Failed to fetch signal value %s for property %s got error: %s", signal, fetch, eina_error_msg_get(error));
2006 return; 2006 return;
2007 } 2007 }
2008 2008
@@ -2079,11 +2079,11 @@ _content_created(Eo *obj, void *data, const Eina_Value value)
2079 eina_value_get(&value, &content); 2079 eina_value_get(&value, &content);
2080 2080
2081 // Recycle old content 2081 // Recycle old content
2082 old_content = elm_layout_content_get(obj, request->key); 2082 old_content = efl_content_get(efl_part(obj, request->key));
2083 if (old_content) efl_ui_factory_release(request->factory, old_content); 2083 if (old_content) efl_ui_factory_release(request->factory, old_content);
2084 2084
2085 // Set new content 2085 // Set new content
2086 elm_layout_content_set(obj, request->key, content); 2086 efl_content_set(efl_part(obj, request->key), content);
2087 2087
2088 return value; 2088 return value;
2089} 2089}
@@ -2241,11 +2241,11 @@ _efl_ui_layout_base_efl_ui_view_model_set(Eo *obj, Efl_Ui_Layout_Data *pd, Efl_M
2241 if (factory->in_flight) eina_future_cancel(factory->in_flight); 2241 if (factory->in_flight) eina_future_cancel(factory->in_flight);
2242 2242
2243 // Cleanup content 2243 // Cleanup content
2244 content = elm_layout_content_get(obj, key); 2244 content = efl_content_get(efl_part(obj, key));
2245 elm_layout_content_set(obj, key, NULL); 2245 efl_content_unset(efl_part(obj, key));
2246 2246
2247 // And recycle it 2247 // And recycle it
2248 efl_ui_factory_release(factory->factory, content); 2248 if (content) efl_ui_factory_release(factory->factory, content);
2249 } 2249 }
2250 eina_iterator_free(it); 2250 eina_iterator_free(it);
2251 2251
@@ -2331,8 +2331,8 @@ _efl_ui_layout_base_efl_ui_factory_bind_factory_bind(Eo *obj EINA_UNUSED, Efl_Ui
2331 Efl_Gfx_Entity *old; 2331 Efl_Gfx_Entity *old;
2332 2332
2333 // Unset and recycle 2333 // Unset and recycle
2334 old = elm_layout_content_get(obj, ss_key); 2334 old = efl_content_get(efl_part(obj, ss_key));
2335 elm_layout_content_set(obj, ss_key, NULL); 2335 efl_content_unset(efl_part(obj, ss_key));
2336 if (old) efl_ui_factory_release(tracking->factory, old); 2336 if (old) efl_ui_factory_release(tracking->factory, old);
2337 2337
2338 // Stop in flight request 2338 // Stop in flight request