Why Does My Game Crash When I Try To Quit, And How Do I Fix The Hanging Process Issue

Some MelonLoader users notice that their game crashes, freezes, or stays running in the background after they try to close it. This issue is usually caused by mod unloading problems, background threads created by mods, or incomplete shutdown tasks inside MelonLoader.

This guide explains all real causes and the exact steps to fix them.

Common Reasons Why The Game Crashes On Exit

Here are the most accurate causes, based on how MelonLoader works.

A mod does not shut down correctly

Some mods run background tasks such as:

  • Loops
  • Update hooks
  • Threaded timers
  • Coroutine patches
  • Network calls
  • Audio or animation systems

If the mod does not stop these when you close the game, the game hangs or crashes.

A mod is using unsafe Mono or Il2Cpp patches

Faulty patches can hook into:

  • Update
  • FixedUpdate
  • OnApplicationQuit
  • OnDestroy

If the patch stays active while the game unloads, a crash happens.

Plugins in the Plugins folder are not unloading

Plugins can create long running processes that remain attached to the game even after exit.

Conflicts between two or more mods

Two mods may try to modify:

  • The same method
  • The same class
  • The same event
  • The same shutdown call

Any conflict during cleanup can crash the game.

The game uses an anti debug or anti cheat layer

Some Unity games have security checks that break when MelonLoader or mods do not close cleanly.

Corrupted config files for mods

If a mod tries to save corrupted settings when quitting, the process may hang.

MelonLoader is outdated

Older MelonLoader versions did not handle shutdown as smoothly as newer builds.

How To Confirm This is A Melonloader or Mod Issue

Use these checks:

  • Game closes normally without MelonLoader
  • Game closes normally with MelonLoader installed but with no mods
  • Game only crashes when certain mods are installed
  • Game stays open in the background in Task Manager
  • Latest.log shows errors during shutdown
  • Mod logs show errors in OnApplicationQuit or OnDestroy

If the problem appears only when mods are active, it is a mod or mod conflict issue.

Fixes For The Game Crashing On Exit

These steps solve most shutdown and hanging process problems.

Test mods one by one

This identifies the mod causing the issue.

Steps:

  • Move all mods out of the Mods folder
  • Start the game and exit
  • Re add mods one at a time
  • The mod that causes the crash is the problem

Update every mod to the newest version

Old mods often have bad shutdown code.

Update from:

  • GitHub releases
  • Mod developer pages
  • Game specific modding communities

Remove outdated or abandoned mods

Some mods never received fixes. If updating does not help, remove that mod permanently.

Update MelonLoader

Install the latest version using the official installer.

Latest installer is here: Download Melonloader

Newer versions improve shutdown handling, patching, and mod communication.

Delete MelonLoader config files

Corrupted settings can cause shutdown errors.

Delete:

  • MelonLoader\MelonPreferences.cfg
  • MelonLoader\Config folder (optional)
  • Individual mod config files if needed

They regenerate automatically.

Clean reinstall of MelonLoader

Steps:

  • Delete MelonLoader folder
  • Delete version.dll (or MelonLoader.dll depending on version)
  • Run the installer again
  • Launch the game to rebuild files

Remove plugins that cause background threading

Plugins inside the Plugins folder may create processes that do not exit.

Move them out, test the game, and check which one caused it.

Check Latest.log for shutdown errors

Location:

GameFolder
MelonLoader
Latest.log

Look for lines like:

  • Error unloading assembly
  • Thread could not terminate
  • Exception in OnApplicationQuit
  • Exception in OnDestroy
  • Failed to dispose object

These point directly to the faulty mod.

Make sure antivirus is not blocking shutdown

Rare cases occur where antivirus blocks MelonLoader cleanup.

Add game folder to antivirus exceptions.

Why The Game Stays Running In The Background

When a mod keeps a thread open, Windows treats the game as still running.

Signs:

  • Game closed but still visible in Task Manager
  • CPU still used
  • Memory still used
  • Have to force close manually

Cause examples:

  • A loop that never ends
  • A thread running a timer
  • A networking call waiting for a response
  • A coroutine never stopping

Fix is the same: identify the mod and remove or update it.

Special Cases

Mods that modify online features
Network mods can hang while waiting for a timeout.

Mods that include auto save features
If the mod cannot write to disk, the exit process loops forever.

Mods that modify Unity engine quitting behavior
Some mods unintentionally override UnityEngine.Application.Quit.

Final Fix Checklist

Use this list for a fast diagnosis.

  • Remove all mods
  • Add mods back one by one
  • Update every mod
  • Update MelonLoader
  • Delete config files
  • Remove plugins
  • Review Latest.log
  • Check for threads that stay alive
  • Avoid outdated or abandoned mods
  • Run game without mods to confirm clean exit
  • Use only Windows PC version of the game
  • Never use MelonLoader on macOS or Wine

Following these steps fixes almost all quit crash or hanging process issues.

Official Download Links

Official MelonLoader website
https://melonloader.pro

Download installer
https://melonloader.pro/download-melonloader/

Official GitHub
https://github.com/LavaGang/MelonLoader