Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_entry.c Log Message: * Prevent a crash from ewl entry like the following: ewl_callback_call_with_event_data (w=0x81198c0, t=EWL_CALLBACK_HIDE, ev_data=0x0) at ewl_callback.c:403 403 if (EWL_CALLBACK_FLAGS(parent, t) & EWL_CALLBACK_NOTIFY_INTERCEPT) (gdb) bt #0 ewl_callback_call_with_event_data (w=0x81198c0, t=EWL_CALLBACK_HIDE, ev_data=0x0) at ewl_callback.c:403 #1 0x400363c7 in ewl_callback_call (w=0x81198c0, t=48) at ewl_callback.c:372 #2 0x400b3c48 in ewl_widget_hide (w=0x81198c0) at ewl_widget.c:353 #3 0x400540fa in ewl_entry_cursor_cb_flash_timer (data=0x81198c0) at ewl_entry.c:626 Caused on destroy of an entry =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- ewl_entry.c 3 Nov 2005 01:05:56 -0000 1.33 +++ ewl_entry.c 15 Nov 2005 22:57:09 -0000 1.34 @@ -8,6 +8,8 @@ static int ewl_entry_cursor_cb_flash_timer(void *data); static void ewl_entry_cursor_timer_set(Ewl_Entry_Cursor *c, double time); +static void ewl_entry_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__); /** * @param text: The text to set into the entry @@ -85,10 +87,21 @@ ewl_entry_cb_mouse_down, NULL); ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, ewl_entry_cb_mouse_up, NULL); + ewl_callback_append(w, EWL_CALLBACK_DESTROY, + ewl_entry_cb_destroy, NULL); DRETURN_INT(TRUE, DLEVEL_STABLE); } + +void ewl_entry_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__) +{ + if (EWL_ENTRY(w)->cursor) ewl_widget_destroy(EWL_ENTRY(w)->cursor); +} + + + /** * @param e: The Ewl_Entry to set the multiline status * @param multiline: The multiline status to set @@ -621,12 +634,12 @@ c = data; - if (VISIBLE(c)) + if (c && VISIBLE(c)) { ewl_widget_hide(EWL_WIDGET(c)); ewl_entry_cursor_timer_set(c, EWL_ENTRY_CURSOR_OFF_TIME); } - else + else if (c) ewl_widget_show(EWL_WIDGET(c)); ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs