fix exception when destruction occurs before game has been initialized
This commit is contained in:
@@ -312,7 +312,7 @@ namespace Torch
|
|||||||
|
|
||||||
private void Destroy()
|
private void Destroy()
|
||||||
{
|
{
|
||||||
_game.Dispose();
|
_game?.Dispose();
|
||||||
_game = null;
|
_game = null;
|
||||||
|
|
||||||
MyGameService.ShutDown();
|
MyGameService.ShutDown();
|
||||||
@@ -462,6 +462,7 @@ namespace Torch
|
|||||||
public void SignalDestroy()
|
public void SignalDestroy()
|
||||||
{
|
{
|
||||||
_destroyGame = true;
|
_destroyGame = true;
|
||||||
|
if (_game is not null)
|
||||||
SignalStop();
|
SignalStop();
|
||||||
_commandChanged.Set();
|
_commandChanged.Set();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user