mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- fixed voxels leaking memory.
This commit is contained in:
parent
efe4261932
commit
745d78d8d7
5 changed files with 18 additions and 1 deletions
|
@ -802,6 +802,8 @@ int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, in
|
|||
|
||||
int32_t qloadkvx(int32_t voxindex, const char *filename);
|
||||
void vox_undefine(int32_t const);
|
||||
void vox_deinit();
|
||||
|
||||
void tileCopySection(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz, int32_t tilenume2, int32_t sx2, int32_t sy2);
|
||||
void squarerotatetile(int16_t tilenume);
|
||||
|
||||
|
|
|
@ -10104,6 +10104,15 @@ void vox_undefine(int32_t const tile)
|
|||
// TODO: nextvoxid
|
||||
}
|
||||
|
||||
void vox_deinit()
|
||||
{
|
||||
for (auto &vox : voxmodels)
|
||||
{
|
||||
voxfree(vox);
|
||||
vox = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// inside
|
||||
//
|
||||
|
|
|
@ -842,6 +842,11 @@ void voxfree(voxmodel_t *m)
|
|||
|
||||
DO_FREE_AND_NULL(m->mytex);
|
||||
DO_FREE_AND_NULL(m->quad);
|
||||
for (auto& tex : m->texid)
|
||||
{
|
||||
if (tex) delete tex;
|
||||
tex = nullptr;
|
||||
}
|
||||
|
||||
Xfree(m);
|
||||
}
|
||||
|
|
|
@ -318,6 +318,7 @@ int GameMain()
|
|||
G_SaveConfig();
|
||||
C_DeinitConsole();
|
||||
V_ClearFonts();
|
||||
vox_deinit();
|
||||
TileFiles.ClearTextureCache();
|
||||
TileFiles.CloseAll(); // do this before shutting down graphics.
|
||||
GLInterface.Deinit();
|
||||
|
|
|
@ -1173,7 +1173,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
|
|||
|
||||
// Use this to break at a specific allocation number.
|
||||
|
||||
//_crtBreakAlloc = 253018;
|
||||
_crtBreakAlloc = 250894;
|
||||
#endif
|
||||
|
||||
int ret = DoMain (hInstance);
|
||||
|
|
Loading…
Reference in a new issue