Catch exceptions thrown by graft* and ungraft* in the notify loop so that the gadgets' graft states remain consistent

db4
Joe Groff 2008-01-26 16:59:53 -08:00
parent c28f6ee6ff
commit ca6247f3b3
1 changed files with 6 additions and 6 deletions

View File

@ -120,12 +120,12 @@ SYMBOL: ui-hook
[ dup update-hand draw-world ] each ;
: notify ( gadget -- )
dup gadget-graft-state {
{ { f t } [ dup activate-control dup graft* ] }
{ { t f } [ dup activate-control dup ungraft* ] }
} case
dup gadget-graft-state first { f f } { t t } ?
swap set-gadget-graft-state ;
dup gadget-graft-state [ dup {
{ { f t } [ over activate-control over graft* ] }
{ { t f } [ over activate-control over ungraft* ] }
} case ]
[ first { f f } { t t } ?
swap set-gadget-graft-state ] [ ] cleanup ;
: notify-queued ( -- )
graft-queue [ notify ] dlist-slurp ;