Skip to content

Commit

Permalink
ui: notify the ui-thread in shutdown hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Jun 11, 2024
1 parent 503be81 commit 74b0f91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions basis/ui/ui.factor
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ STARTUP-HOOK: [
]

SHUTDOWN-HOOK: [
close-all-windows notify-queued
ui-running? [ close-all-windows notify-ui-thread yield ] when
]

HOOK: resize-window ui-backend ( world dim -- )
Expand All @@ -231,7 +231,7 @@ M: object resize-window 2drop ;
: with-ui ( quot: ( -- ) -- )
ui-running? [ call( -- ) ] [
t ui-running set-global '[
[ init-ui @ ] (with-ui)
_ (with-ui)
] [
f ui-running set-global
! Give running ui threads a chance to finish.
Expand Down

0 comments on commit 74b0f91

Please sign in to comment.