Skip to content
Snippets Groups Projects
Commit 340ac9c8 authored by baletiballo's avatar baletiballo
Browse files

Make sure the local MMT server gets killed if the game unexpectedly closes in a level

Doesn't work in the launch menu, because globalObject doesn't exist there yet, but still better than nothing
parent 9d37aaff
Branches
No related tags found
No related merge requests found
......@@ -277,4 +277,19 @@ IEnumerator _GetContextfromServer()
yield break;
}
}
/// <summary>
/// Make sure the local MMT server gets killed if the game closes.
/// </summary>
private void OnApplicationQuit()
{
StreamingAssetLoader.NetworkJSON_Save();
if (CommunicationEvents.process_mmt_frameIT_server != null)
{
if (!CommunicationEvents.process_mmt_frameIT_server.HasExited)
{
CommunicationEvents.process_mmt_frameIT_server.Kill();
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment