1
0
forked from 0ad/0ad

Fix a crash in WaterRenderer.cpp

This fixes a rare crash at map generation.
The water renderer could be left in an invalid state when exiting a
game, and would then crash on the next map generation in some cases.

Tested by: Stan
Differential Revision: https://code.wildfiregames.com/D3447
This was SVN commit r24759.
This commit is contained in:
wraitii 2021-01-22 08:14:27 +00:00
parent 993ccc6034
commit f2b3c4d8ec

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2021 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -55,6 +55,9 @@ public:
virtual void Deinit()
{
// Clear the map size & data.
if (CRenderer::IsInitialised())
g_Renderer.GetWaterManager()->SetMapSize(0);
}
virtual void Serialize(ISerializer& serialize)