mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- fixed some memory leaks: The global symbol table and the argument list for DECORATE called action specials were never freed.
This commit is contained in:
parent
137e624b55
commit
2d0f6339f7
7 changed files with 24 additions and 2 deletions
|
@ -2261,6 +2261,8 @@ void D_DoomMain (void)
|
|||
|
||||
do
|
||||
{
|
||||
InitGlobalSymbols();
|
||||
|
||||
if (restart)
|
||||
{
|
||||
C_InitConsole(SCREENWIDTH, SCREENHEIGHT, false);
|
||||
|
|
|
@ -517,8 +517,18 @@ void PType::StaticInit()
|
|||
TypeTable.AddType(TypeState = new PStatePointer);
|
||||
TypeTable.AddType(TypeFixed = new PFixed);
|
||||
TypeTable.AddType(TypeAngle = new PAngle);
|
||||
}
|
||||
|
||||
void ReleaseGlobalSymbols()
|
||||
{
|
||||
GlobalSymbols.ReleaseSymbols();
|
||||
}
|
||||
|
||||
void InitGlobalSymbols()
|
||||
{
|
||||
// Add types to the global symbol table.
|
||||
atterm(ReleaseGlobalSymbols);
|
||||
GlobalSymbols.ReleaseSymbols();
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_sByte, TypeSInt8));
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Byte, TypeUInt8));
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Short, TypeSInt16));
|
||||
|
|
|
@ -801,4 +801,6 @@ public:
|
|||
PSymbolConstString() {}
|
||||
};
|
||||
|
||||
void InitGlobalSymbols();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -72,11 +72,11 @@ FxVMFunctionCall *DoActionSpecials(FScanner &sc, FState & state, Baggage &bag)
|
|||
int min_args, max_args;
|
||||
FString specname = sc.String;
|
||||
|
||||
FArgumentList *args = new FArgumentList;
|
||||
int special = P_FindLineSpecial(sc.String, &min_args, &max_args);
|
||||
|
||||
if (special > 0 && min_args >= 0)
|
||||
{
|
||||
FArgumentList *args = new FArgumentList;
|
||||
args->Push(new FxParameter(new FxConstant(special, sc)));
|
||||
i = 0;
|
||||
|
||||
|
|
|
@ -1279,7 +1279,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
|
|||
_CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF);
|
||||
|
||||
// Use this to break at a specific allocation number.
|
||||
//_crtBreakAlloc = 18800;
|
||||
_crtBreakAlloc = 22884;
|
||||
#endif
|
||||
|
||||
DoMain (hInstance);
|
||||
|
|
|
@ -1293,6 +1293,10 @@ void I_StartupRawPS2()
|
|||
{
|
||||
JoyDevices[INPUT_RawPS2] = joys;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete joys;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -783,6 +783,10 @@ void I_StartupXInput()
|
|||
{
|
||||
JoyDevices[INPUT_XInput] = joys;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete joys;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue