Skip to content

Commit f74e4db

Browse files
committed
harden lazy reveal
1 parent 86fc98a commit f74e4db

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/textual/lazy.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,15 @@ async def check_children() -> None:
115115
if not widgets:
116116
return
117117
widget = widgets.pop(0)
118-
await parent.mount(widget)
118+
try:
119+
await parent.mount(widget)
120+
except Exception:
121+
# I think this can occur if the parent is removed before all children are added
122+
# Only noticed this on shutdown
123+
return
124+
119125
if widgets:
120-
parent.call_next(check_children)
126+
parent.set_timer(0.02, check_children)
121127

122128
parent.call_next(check_children)
123129

0 commit comments

Comments
 (0)