Fixed a memory leak the size of Russia.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2520 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2007-07-16 17:14:39 +00:00
parent dcec305bd9
commit d0c6093ae4
1 changed files with 8 additions and 2 deletions

View File

@ -71,10 +71,10 @@ void PRAddressableFlush(progfuncs_t *progfuncs, int totalammount)
if (addressablehunk)
#ifdef _WIN32
VirtualFree(addressablehunk, 0, MEM_RELEASE); //doesn't this look complicated? :p
VirtualFree(addressablehunk, 0, MEM_RELEASE); //doesn't this look complicated? :p
addressablehunk = VirtualAlloc (NULL, totalammount, MEM_RESERVE, PAGE_NOACCESS);
#else
free(addressablehunk);
free(addressablehunk);
addressablehunk = malloc(totalammount); //linux will allocate-on-use anyway, which is handy.
// memset(addressablehunk, 0xff, totalammount);
#endif
@ -628,6 +628,12 @@ void CloseProgs(progfuncs_t *inst)
PRHunkFree(inst, 0);
#ifdef _WIN32
VirtualFree(addressablehunk, 0, MEM_RELEASE); //doesn't this look complicated? :p
#else
free(inst->addressablehunk);
#endif
/*
while(inst->prinst->extensionbuiltin)
{