Windows player is closed, but the game still runs in the background unintentionally

I’m working on a Windows build for my game, and as far as I can tell I’m not launching any background processes, and I’m not starting any threads. I do use a lot of coroutines.

If the game is closed by clicking the X on the window, I’ll still see it running as a background process in the task manager. I’m not sure how to even start to debug this – the profiler disconnects, so I’m not sure what processes are still running. I have logs in OnApplicationQuit, so I can tell that’s being called normally.

Let me know if you’ve seen anything like this, or if you have ideas!

try looking into windows application logs, they are in the Event Viewer. maybe there is more info there.

Oh I didn’t know about that, thanks. Unfortunately I just checked and there’s nothing there. I repro’d this with a completely new Unity project (just the URP template) and it still happened, so I think it’s either a Unity issue or something weird w/ my computer (although the computer’s also new, so I’m not sure what it would be).

I just noted the same, with an empty URP project. First opened in 2022.3.55f1 and all is okay, after opening in 6000.0.32f1 the player executable doesn’t completely close. It is a known bug, see Unity Issue Tracker - Player remains in Windows Background processes when the application is closed

Yeah, that’s the bug I submitted :/. I’ll try the workaround somebody else posted.