Properly save replay even when the game crashes (fixes #5610)

This commit is contained in:
Pavlos Touboulidis
2014-06-24 22:40:20 +03:00
parent 66325f4941
commit e19dae8eec

View File

@@ -483,6 +483,8 @@ namespace OpenRA
SetIdealFrameTime(Settings.Graphics.MaxFramerate);
try
{
while (state == RunStatus.Running)
{
if (Settings.Graphics.CapFramerate)
@@ -498,10 +500,13 @@ namespace OpenRA
else
Tick(orderManager);
}
}
finally
{
// Ensure that the active replay is properly saved
if (orderManager != null)
orderManager.Dispose();
}
Renderer.Device.Dispose();