Fix for missing unregistration of atspi objects 03/195203/3
authorRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Tue, 11 Dec 2018 12:44:19 +0000 (13:44 +0100)
committerLukasz Oleksak <l.oleksak@samsung.com>
Tue, 11 Dec 2018 15:00:48 +0000 (15:00 +0000)
Atspi objects weren't properly unregistered, when being destroyed. As a
result atspi query could come from screen-reader, which could cause
application to use object, that was already destroyed and crash an
application.

Change-Id: If50076b06816957df5707528b8147af6eb69c306

src/lib/elementary/efl_access_object.c
src/lib/elementary/efl_ui_widget.c
src/lib/elementary/elm_atspi_bridge.c

index 5ad4587..2f41c7d 100644 (file)
@@ -8,6 +8,10 @@
 #include "elm_widget.h"
 #include "elm_priv.h"
 
+//TIZEN_ONLY(20181211): Fix for missing unregistration of atspi objects
+void unregister_atspi_object_in_bridge(const Eo *obj);
+//
+
 const char* Access_Name[] = {
     "invalid",
     "accelerator label",
@@ -839,6 +843,9 @@ _efl_access_object_efl_object_destructor(Eo *obj, Efl_Access_Object_Data *pd)
    eina_stringshare_del(pd->description);
    eina_stringshare_del(pd->translation_domain);
    efl_access_relation_set_free(&pd->relations);
+   //TIZEN_ONLY(20181211): Fix for missing unregistration of atspi objects
+   unregister_atspi_object_in_bridge(obj);
+   //
 
    efl_destructor(efl_super(obj, EFL_ACCESS_OBJECT_MIXIN));
 }
index 84b066d..24bd826 100644 (file)
@@ -5561,7 +5561,6 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
    //
 
    efl_access_object_attributes_clear(eo_item);
-   efl_access_removed(eo_item);
 
    // TIZEN_ONLY(20150709) : atspi relations api
    if (item->atspi_custom_relations)
@@ -7101,7 +7100,6 @@ _efl_ui_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
    //
 
    efl_access_object_attributes_clear(obj);
-   efl_access_removed(obj);
    if (sd->logical.parent)
      {
         efl_weak_unref(&sd->logical.parent);
index 399a285..1c3c6ec 100644 (file)
@@ -6242,6 +6242,15 @@ _on_object_add(void *data, const Efl_Event *event)
    eldbus_service_signal_send(pd->cache_interface, sig);
 }
 
+//TIZEN_ONLY(20181211): Fix for missing unregistration of atspi objects
+void
+unregister_atspi_object_in_bridge(const Eo *obj)
+{
+   Eo *bridge = _elm_atspi_bridge_get();
+   _bridge_object_unregister(bridge, obj);
+}
+//
+
 static void
 _on_object_del(void *data, const Efl_Event *event)
 {
@@ -6249,7 +6258,9 @@ _on_object_del(void *data, const Efl_Event *event)
 
    ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(data, pd);
 
-   _bridge_object_unregister(data, event->object);
+   //TIZEN_ONLY(20181211): Fix for missing unregistration of atspi objects
+   unregister_atspi_object_in_bridge(event->object);
+   //
 
    sig = eldbus_service_signal_new(pd->cache_interface, ATSPI_OBJECT_CHILD_REMOVED);
    Eldbus_Message_Iter *iter = eldbus_message_iter_get(sig);