mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Re-expose kpzbufsiz and set it to zero in uninitengine, preventing potential crashes from successive re-initializations of the engine.
git-svn-id: https://svn.eduke32.com/eduke32@5254 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b7b23310e3
commit
410406158a
3 changed files with 3 additions and 2 deletions
|
@ -15,6 +15,7 @@ int32_t cache1d_file_fromzip(int32_t fil);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern char *kpzbuf;
|
extern char *kpzbuf;
|
||||||
|
extern int32_t kpzbufsiz;
|
||||||
extern int32_t kpzbufloadfil(int32_t);
|
extern int32_t kpzbufloadfil(int32_t);
|
||||||
extern int32_t kpzbufload(const char *);
|
extern int32_t kpzbufload(const char *);
|
||||||
|
|
||||||
|
|
|
@ -56,11 +56,10 @@ static intptr_t kzipopen(const char *filnam)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *kpzbuf = NULL;
|
char *kpzbuf = NULL;
|
||||||
|
int32_t kpzbufsiz;
|
||||||
|
|
||||||
int32_t kpzbufloadfil(int32_t const handle)
|
int32_t kpzbufloadfil(int32_t const handle)
|
||||||
{
|
{
|
||||||
static int32_t kpzbufsiz = 0;
|
|
||||||
|
|
||||||
int32_t const leng = kfilelength(handle);
|
int32_t const leng = kfilelength(handle);
|
||||||
if (leng > kpzbufsiz)
|
if (leng > kpzbufsiz)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9275,6 +9275,7 @@ void uninitengine(void)
|
||||||
DO_FREE_AND_NULL(blockptr);
|
DO_FREE_AND_NULL(blockptr);
|
||||||
#endif
|
#endif
|
||||||
DO_FREE_AND_NULL(kpzbuf);
|
DO_FREE_AND_NULL(kpzbuf);
|
||||||
|
kpzbufsiz = 0;
|
||||||
|
|
||||||
uninitsystem();
|
uninitsystem();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue