[gl] Free alias model cache memory when clearing models

Like sw, gl uses the cache for alias models and thus needs to free the
cache memory when unloading the model.
This commit is contained in:
Bill Currie 2023-03-21 13:18:16 +09:00
parent 793525a50a
commit 3fbac33ee8

View file

@ -52,6 +52,14 @@
#include "compat.h"
static void
gl_alias_clear (model_t *m, void *data)
{
m->needload = true;
Cache_Free (&m->cache);
}
static void
gl_Mod_LoadSkin (mod_alias_ctx_t *alias_ctx, byte *texels,
int snum, int gnum, maliasskindesc_t *skindesc)
@ -124,6 +132,8 @@ gl_Mod_FinalizeAliasModel (mod_alias_ctx_t *alias_ctx)
header->mdl.scale_origin[2] -= (22 + 8);
VectorScale (header->mdl.scale, 2, header->mdl.scale);
}
alias_ctx->mod->clear = gl_alias_clear;
}
static void