The shutdown process is expecting the Windows message queue to be available to pump messages.
In the PPSSPP implementation, the shutdown is called from a background thread, and the UI thread is blocked waiting for the background thread to stop. This causes a deadlock.
The solution is to change the calls that close the windows to use PostMessage, and let the message queue actually close the windows when it frees up. However, at that point the DLL is no longer loaded, so there were several issues trying to dispatch messages to the custom WndProcs. To address that, as part of the shutdown process, replace all of the custom WndProcs with default ones.
The shutdown process is expecting the Windows message queue to be available to pump messages.
In the PPSSPP implementation, the shutdown is called from a background thread, and the UI thread is blocked waiting for the background thread to stop. This causes a deadlock.
The solution is to change the calls that close the windows to use PostMessage, and let the message queue actually close the windows when it frees up. However, at that point the DLL is no longer loaded, so there were several issues trying to dispatch messages to the custom WndProcs. To address that, as part of the shutdown process, replace all of the custom WndProcs with default ones.