1
0
forked from 0ad/0ad

fix bug #71 - was a double-free (both ~CRenderer and UnloadResources were calling UnloadWaterTextures)

This was SVN commit r3071.
This commit is contained in:
janwas 2005-10-31 18:57:03 +00:00
parent 6af5888866
commit 74bf76d523
4 changed files with 6 additions and 4 deletions

View File

@ -306,6 +306,7 @@ void CGameView::UnloadResources()
// g_ObjMan.UnloadObjects();
g_Renderer.UnloadAlphaMaps();
g_Renderer.UnloadWaterTextures();
}

View File

@ -67,7 +67,7 @@ class CGameView: public CJSObject<CGameView>
// InitResources(): Load all graphics resources (textures, actor objects and
// alpha maps) required by the game
void InitResources();
//void InitResources();
// UnloadResources(): Unload all graphics resources loaded by InitResources
void UnloadResources();

View File

@ -747,7 +747,7 @@ static int h_free_idx(i32 idx, HDATA* hd)
fn_free(hd);
memset(hd, 0, sizeof(HDATA));
memset(hd, 0, sizeof(*hd));
free_idx(idx);

View File

@ -167,8 +167,9 @@ CRenderer::~CRenderer()
delete m_VertexShader;
m_VertexShader = 0;
UnloadAlphaMaps();
UnloadWaterTextures();
// we no longer UnloadAlphaMaps / UnloadWaterTextures here -
// that is the responsibility of the module that asked for
// them to be loaded (i.e. CGameView).
}