# HG changeset patch # User wycc # Date 1236407095 -28800 # Node ID 01038b8d8f05849d9309713009e513085b6db626 # Parent f90c60967a9c0563926a871f8aa9978b1438ebdd Set the progm to be NULL so that we won't call mb_progm_abort when we call it at the next time. This will fix the crash issue of the dynamic. However, the dynamic is still crash sometimes if we click the button quickly. It looks like it crashes in the refresh. We need to future figure out the issue. diff -r f90c60967a9c -r 01038b8d8f05 src/mbaf/mbbutton.c --- a/src/mbaf/mbbutton.c Sat Mar 07 08:33:01 2009 +0800 +++ b/src/mbaf/mbbutton.c Sat Mar 07 14:24:55 2009 +0800 @@ -56,6 +56,14 @@ mb_button_refresh(btn); } +static void mb_button_end_animated_cb(event_t *evt, void *arg) +{ + mb_button_t *btn = (mb_button_t *) arg; + + btn->progm = NULL; + +} + static void mb_button_pressed(event_t *evt, void *arg) { mb_button_t *btn = (mb_button_t *) arg; @@ -80,6 +88,7 @@ mb_visibility_new(VIS_HIDDEN, btn->click, word); mb_visibility_new(VIS_VISIBLE, btn->active, word); mb_progm_free_completed(progm); + subject_add_observer(mb_progm_get_complete(btn->progm), mb_button_end_animated_cb,btn); get_now(&now); printf("rt = %x\n", btn->rdman->rt); mb_progm_start(progm, X_MB_tman(btn->rdman->rt), &now);