Catch exceptions thrown by graft* and ungraft* in the notify loop so that the gadgets' graft states remain consistent
parent
c28f6ee6ff
commit
ca6247f3b3
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue