discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=0b5f65d4a8b61e1497e52aca86d52e58ffce8edf

commit 0b5f65d4a8b61e1497e52aca86d52e58ffce8edf
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Mar 17 13:17:02 2017 -0400

    always use jobs to create bryce menus
    
    ensure that menus can never be created during a post event callback in
    order to avoid crashes
    
    ref T3144
    fix T5262
---
 src/bin/e_bryce.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_bryce.c b/src/bin/e_bryce.c
index a721ab2..2042e7a 100644
--- a/src/bin/e_bryce.c
+++ b/src/bin/e_bryce.c
@@ -34,6 +34,7 @@ typedef struct Bryce
    unsigned int autohide_blocked;
    Eina_List *popups;
    void *event_info;
+   Ecore_Job *menu_job;
    uint64_t last_timestamp;
 
    /* config: do not bitfield! */
@@ -579,7 +580,8 @@ _bryce_mouse_down_post(void *data, Evas *e EINA_UNUSED)
      return EINA_FALSE;
    if (ev->button != 3) return EINA_TRUE;
    b->last_timestamp = ev->timestamp;
-   _bryce_act_menu_job(b);
+   if (!b->menu_job)
+     b->menu_job = ecore_job_add(_bryce_act_menu_job, b);
    return EINA_FALSE;
 }
 
@@ -671,6 +673,7 @@ _bryce_del(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *
      }
    evas_object_del(b->autohide_event);
    E_FREE_FUNC(b->calc_job, ecore_job_del);
+   E_FREE_FUNC(b->menu_job, ecore_job_del);
    E_FREE_FUNC(b->autohide_timer, ecore_timer_del);
    ecore_timer_del(b->save_timer);
    EINA_LIST_FREE(b->popups, p)
@@ -980,6 +983,7 @@ _bryce_act_menu_job(void *data)
 
    m = e_menu_new();
    _bryce_menu_populate(b, m);
+   b->menu_job = NULL;
    evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
    e_menu_activate_mouse(m, e_zone_current_get(), x, y, 1, 1, 
E_MENU_POP_DIRECTION_AUTO, b->last_timestamp);
    _bryce_popup(b, m->comp_object);
@@ -992,8 +996,8 @@ _bryce_act_menu(E_Object *obj, const char *params 
EINA_UNUSED, E_Binding_Event_M
    if (obj->type != E_BRYCE_TYPE) return EINA_FALSE;
    b = e_object_data_get(obj);
    b->last_timestamp = ev->timestamp;
-   /* FIXME: T3144 */
-   ecore_job_add(_bryce_act_menu_job, b);
+   if (!b->menu_job)
+     b->menu_job = ecore_job_add(_bryce_act_menu_job, b);
    return EINA_TRUE;
 }
 

-- 


Reply via email to