Skip to content

fix: deadlock on close due to LuaRenderer#580

Merged
Aurumaker72 merged 1 commit intomainfrom
fix-deadlock-on-close
Mar 30, 2026
Merged

fix: deadlock on close due to LuaRenderer#580
Aurumaker72 merged 1 commit intomainfrom
fix-deadlock-on-close

Conversation

@Aurumaker72
Copy link
Copy Markdown
Member

changelog: skip

Copilot AI review requested due to automatic review settings March 30, 2026 15:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix an application-close deadlock attributed to LuaRenderer by moving renderer shutdown to a pre-destroy phase while the UI thread is still responsive.

Changes:

  • Introduce a new WM_PREDESTROY window message for a staged shutdown sequence.
  • Adjust WndProc close flow to close the ROM asynchronously, then trigger WM_PREDESTROY to stop LuaRenderer and destroy the main window.
  • Move g_main_ctx.exiting / LuaDialog::close_all() into WM_DESTROY and remove LuaRenderer::stop() from WM_DESTROY.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Views.Win32/Main.h Adds WM_PREDESTROY message constant used for staged shutdown.
src/Views.Win32/Main.cpp Reworks WM_CLOSE/WM_DESTROY handling and adds WM_PREDESTROY to stop LuaRenderer before DestroyWindow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Aurumaker72 Aurumaker72 merged commit 2a72f4e into main Mar 30, 2026
14 of 15 checks passed
@Aurumaker72 Aurumaker72 deleted the fix-deadlock-on-close branch March 30, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants