Forward port workaround for eventRemoveContext crash from 2.1. This will leak some memory.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5260 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
94f523d9ef
commit
0d706d02fd
|
@ -673,14 +673,17 @@ void eventRemoveContext(SCRIPT_CONTEXT *psContext)
|
|||
for(psCChunk = psContext->psGlobals; psCChunk; psCChunk = psNChunk)
|
||||
{
|
||||
psNChunk = psCChunk->psNext;
|
||||
for(i=0;i < CONTEXT_VALS ; i++)
|
||||
// FIXME FIXME FIXME - this is commented away because it made loading
|
||||
// different savegames many times crash for inexplicable reasons. It
|
||||
// will probably leak memory, though!
|
||||
/* for(i=0;i < CONTEXT_VALS ; i++)
|
||||
{
|
||||
if (psCChunk->asVals[i].type == VAL_STRING && psCChunk->asVals[i].v.sval)
|
||||
{
|
||||
free(psCChunk->asVals[i].v.sval);
|
||||
psCChunk->asVals[i].v.sval = NULL;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
free(psCChunk);
|
||||
}
|
||||
psContext->psGlobals = NULL;
|
||||
|
|
Loading…
Reference in New Issue