mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 15:32:57 +00:00
- tried to make 'restart' CCMD work again.
This requires quite a bit more thorough cleanup. I got it to the point where the titlepic appears after restarting, but it still crashes when starting the game so there's more data that needs to be cleaned up...
This commit is contained in:
parent
450e5aec52
commit
91b05366d6
4 changed files with 26 additions and 15 deletions
|
@ -1973,8 +1973,6 @@ static void D_DoomInit()
|
||||||
M_FindResponseFile ();
|
M_FindResponseFile ();
|
||||||
|
|
||||||
atterm(FinalGC);
|
atterm(FinalGC);
|
||||||
PClass::StaticInit();
|
|
||||||
PType::StaticInit();
|
|
||||||
|
|
||||||
// Combine different file parameters with their pre-switch bits.
|
// Combine different file parameters with their pre-switch bits.
|
||||||
Args->CollectFiles("-deh", ".deh");
|
Args->CollectFiles("-deh", ".deh");
|
||||||
|
@ -2261,7 +2259,8 @@ void D_DoomMain (void)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
InitGlobalSymbols();
|
PClass::StaticInit();
|
||||||
|
PType::StaticInit();
|
||||||
|
|
||||||
if (restart)
|
if (restart)
|
||||||
{
|
{
|
||||||
|
@ -2637,6 +2636,8 @@ void D_DoomMain (void)
|
||||||
S_Shutdown(); // free all channels and delete playlist
|
S_Shutdown(); // free all channels and delete playlist
|
||||||
C_ClearAliases(); // CCMDs won't be reinitialized so these need to be deleted here
|
C_ClearAliases(); // CCMDs won't be reinitialized so these need to be deleted here
|
||||||
DestroyCVarsFlagged(CVAR_MOD); // Delete any cvar left by mods
|
DestroyCVarsFlagged(CVAR_MOD); // Delete any cvar left by mods
|
||||||
|
ReleaseGlobalSymbols();
|
||||||
|
PClass::StaticShutdown();
|
||||||
|
|
||||||
GC::FullGC(); // perform one final garbage collection before deleting the class data
|
GC::FullGC(); // perform one final garbage collection before deleting the class data
|
||||||
restart++;
|
restart++;
|
||||||
|
|
|
@ -472,8 +472,17 @@ void PType::GetTypeIDs(intptr_t &id1, intptr_t &id2) const
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
void ReleaseGlobalSymbols()
|
||||||
|
{
|
||||||
|
TypeTable.Clear();
|
||||||
|
GlobalSymbols.ReleaseSymbols();
|
||||||
|
}
|
||||||
|
|
||||||
void PType::StaticInit()
|
void PType::StaticInit()
|
||||||
{
|
{
|
||||||
|
// Add types to the global symbol table.
|
||||||
|
atterm(ReleaseGlobalSymbols);
|
||||||
|
|
||||||
// Set up TypeTable hash keys.
|
// Set up TypeTable hash keys.
|
||||||
RUNTIME_CLASS(PErrorType)->TypeTableType = RUNTIME_CLASS(PErrorType);
|
RUNTIME_CLASS(PErrorType)->TypeTableType = RUNTIME_CLASS(PErrorType);
|
||||||
RUNTIME_CLASS(PVoidType)->TypeTableType = RUNTIME_CLASS(PVoidType);
|
RUNTIME_CLASS(PVoidType)->TypeTableType = RUNTIME_CLASS(PVoidType);
|
||||||
|
@ -517,18 +526,7 @@ void PType::StaticInit()
|
||||||
TypeTable.AddType(TypeState = new PStatePointer);
|
TypeTable.AddType(TypeState = new PStatePointer);
|
||||||
TypeTable.AddType(TypeFixed = new PFixed);
|
TypeTable.AddType(TypeFixed = new PFixed);
|
||||||
TypeTable.AddType(TypeAngle = new PAngle);
|
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_sByte, TypeSInt8));
|
||||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Byte, TypeUInt8));
|
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Byte, TypeUInt8));
|
||||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Short, TypeSInt16));
|
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Short, TypeSInt16));
|
||||||
|
@ -2061,6 +2059,17 @@ void PClass::StaticShutdown ()
|
||||||
}
|
}
|
||||||
TypeTable.Clear();
|
TypeTable.Clear();
|
||||||
bShutdown = true;
|
bShutdown = true;
|
||||||
|
|
||||||
|
AllClasses.Clear();
|
||||||
|
PClassActor::AllActorClasses.Clear();
|
||||||
|
|
||||||
|
FAutoSegIterator probe(CRegHead, CRegTail);
|
||||||
|
|
||||||
|
while (*++probe != NULL)
|
||||||
|
{
|
||||||
|
((ClassReg *)*probe)->MyClass = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -801,6 +801,6 @@ public:
|
||||||
PSymbolConstString() {}
|
PSymbolConstString() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
void InitGlobalSymbols();
|
void ReleaseGlobalSymbols();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -170,6 +170,7 @@ DFsScript::DFsScript()
|
||||||
|
|
||||||
void DFsScript::Destroy()
|
void DFsScript::Destroy()
|
||||||
{
|
{
|
||||||
|
if (this == global_script) global_script = NULL;
|
||||||
ClearVariables(true);
|
ClearVariables(true);
|
||||||
ClearSections();
|
ClearSections();
|
||||||
ClearChildren();
|
ClearChildren();
|
||||||
|
|
Loading…
Reference in a new issue