Move openings deinit to r_memory

This commit is contained in:
Magnus Norddahl 2017-01-04 19:13:58 +01:00
parent e0f1fc4066
commit 4bcc34f01c
3 changed files with 11 additions and 8 deletions

View file

@ -102,7 +102,6 @@ static void R_ShutdownRenderer();
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern short *openings;
extern int fuzzviewheight;
@ -391,13 +390,7 @@ static void R_ShutdownRenderer()
R_DeinitSprites();
R_DeinitPlanes();
Clip3DFloors::Instance()->Cleanup();
// Free openings
if (openings != NULL)
{
M_Free (openings);
openings = NULL;
}
R_DeinitOpenings();
R_FreeDrawSegs();
}

View file

@ -61,4 +61,13 @@ namespace swrenderer
{
lastopening = 0;
}
void R_DeinitOpenings()
{
if (openings != nullptr)
{
M_Free(openings);
openings = nullptr;
}
}
}

View file

@ -19,4 +19,5 @@ namespace swrenderer
ptrdiff_t R_NewOpening(ptrdiff_t len);
void R_FreeOpenings();
void R_DeinitOpenings();
}