Crash at UnityPlayer.dll!MemoryManager::GetAllocator(struct MemLabelId)

Hi, calling CallWindowProcW(wndProc, hWnd, message, wParam, lParam) with the following parameters in our game will cause UnityPlayer.dll to crash. Does anyone know the possible reason?

Latest unity lts?

It is a recently launched game, and Unity should be a relatively new version.

Isn’t it your game?
Then make the devs post the issue and report the issue to them

You are not supposed to call WM_QUIT in middle of the game loop, Unity doesn’t expect that (and I can’t even tell whether you’re calling it from the right thread). Call Application.Quit() instead.

Message 16 is WM_CLOSE. We captures all windows messages, deals with it (in this case, it doesnt do a lot) and retransmit if needed to the actual game using CallWindowProc. In this case, we got a WM_CLOSE from Windows and retransmit it to the game.

Do you have a full callstack with “External Code” frames expanded?

Re WM_QUIT/WM_CLOSE: my bad, I typed the wrong thing. However, the same thing applies to WM_CLOSE. That said, if Windows is sending this message, it shouldn’t be crashing.