[BUG] Unity 6 Build Game Process Continues Running in Background After Closing Window

After upgrading to unity 6. When I try to close my multiplayer game, the process continues running in the background even after closing the window.

Specifically:

  • When I press Alt + F4 or click the close button, only the game window closes
  • The game process remains active in the background
  • This happens immediately after launching the game
  • The issue occurs even before connecting to the Network Manager or loading the main menu
  • I can verify this by checking Task Manager, where the process is still running

Technical Details:

  • Unity Version: 6000.0.32
  • Build Type: Mono
  • Network Solution: NGO
  • NGO Version: 2.1.1

Steps to Reproduce:

  1. Launch the game
  2. Attempt to close it using Alt + F4 or the window close button
  3. Check Task Manager to confirm the process is still running

Has anyone encountered this issue or knows how to properly terminate the game process when closing the window?

5 Likes

This should not happen. I suspect this has something to do with the project rather than being a general issue. Try to strip down a copy of the project to the bare minimum that exhibits this behavior.

I would start with leaving only an empty scene in the build scene list. If this shuts down properly you know it‘s a project specific issue. Otherwise it may be a bug, a project setting (or several), an installed package or asset that still makes it into the build somehow, or less likely a system issue (eg drivers).

1 Like

Hi, I also have this bug on Unity 6000 - (thread)

I made a minimal project that reproduces this bug - download zipped project

4 Likes

That is awesome… now please report it!

If you have a bug, there is only one way to report it.

Help → Report A Bug.

Report one bug at a time with all the expected supporting information attached.

Any other way is NOT a bug report and is NOT going to change anything.

Hello. I’m experiencing exactly the same issue. I’m using Unity 6, and it didn’t occur in previous versions. I don’t believe it’s a problem specific to individual projects.

2 Likes

I encountered the same issue. I’m using Unity version 6000.0.32f1. I have two different game projects: one is singleplayer, and the other is a multiplayer game using custom TCP/UDP communication. I tested both projects with an empty scene and a normal scene, but even after closing the game, the process continues running in the background. I also tried switching between IL2CPP and Mono for builds, but none of them solved the issue.

1 Like

I’m also experiencing the same issue in Unity 6000.0.32f1 where my game leaves multiple background processes running after closing. Initially, I thought it was related to the NetworkManager (Netcode) or Steam API, but after testing, I confirmed it’s not caused by them.

What’s strange is that these background processes keep stacking up. I noticed this when my computer started slowing down, and when I checked the Task Manager, there were around 20 background processes for my game, each using about 150 MB of RAM.

Additionally, I noticed a difference based on the scene loading status:
If I close the game after the scene loads, each background process uses ~150 MB of RAM.
If I close the game before the scene loads, each process only uses ~60 MB of RAM.

3 Likes

I just noticed that as well, Unity 6. Just upgrade to the latest version (33f1) and it happens even with a brand new project. Mine was the HDRP base template. Nothing added, just build this, run the game, close, and the process will stick in the windows process list, and never kill itself.

It piles up if we run the game again and again.

2 Likes

I have this issue, too. Has anyone filed a bug already that we all can vote on?

1 Like

Hello

I’ve been waiting for Unity support, but it didn’t work, so I found this solution which works for me. Put the script below in a GameObject that exists in every scene:

using UnityEngine;

public class ApplicationQuitHandler : MonoBehaviour
{
    void OnApplicationQuit()
    {
        if (!Application.isEditor)
        {
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }
    }
}
2 Likes