fix(emscripten): stop the rAF draw loop outliving the window (#184) #185
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
OragonEfreet/banjo!185
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/184"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
em_on_frame re-armed requestAnimationFrame whenever damage_pending was
set at the end of a frame, and nothing ever cancelled a pending rAF.
After the app quit (or any window lifetime ended without cancellation),
the draw loop kept firing on freed memory and presented black/stale
frames over the live embed — on the 1976 Breakout blog page ~93% of
putImageData calls were black and the canvas flickered.
emscripten_window_del before the free; every new window clears it.
the browser never cancels a pending rAF by itself.