mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- do not delete the namespaces when removing compiler symbols. They still get referenced by some types and must remain until the engine shuts down.
This commit is contained in:
parent
7186342221
commit
d014395dae
2 changed files with 7 additions and 5 deletions
|
@ -267,6 +267,7 @@ void PClass::StaticShutdown ()
|
|||
{
|
||||
p.PendingWeapon = nullptr;
|
||||
}
|
||||
Namespaces.ReleaseSymbols();
|
||||
|
||||
// This must be done in two steps because the native classes are not ordered by inheritance,
|
||||
// so all meta data must be gone before deleting the actual class objects.
|
||||
|
@ -275,7 +276,6 @@ void PClass::StaticShutdown ()
|
|||
// Unless something went wrong, anything left here should be class and type objects only, which do not own any scripts.
|
||||
bShutdown = true;
|
||||
TypeTable.Clear();
|
||||
Namespaces.ReleaseSymbols();
|
||||
ClassDataAllocator.FreeAllBlocks();
|
||||
AllClasses.Clear();
|
||||
PClassActor::AllActorClasses.Clear();
|
||||
|
|
|
@ -512,13 +512,16 @@ PNamespace *FNamespaceManager::NewNamespace(int filenum)
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
// Deallocate the entire namespace manager.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FNamespaceManager::ReleaseSymbols()
|
||||
{
|
||||
RemoveSymbols();
|
||||
for (auto ns : AllNamespaces)
|
||||
{
|
||||
delete ns;
|
||||
}
|
||||
GlobalNamespace = nullptr;
|
||||
AllNamespaces.Clear();
|
||||
}
|
||||
|
@ -537,7 +540,7 @@ int FNamespaceManager::RemoveSymbols()
|
|||
for (auto ns : AllNamespaces)
|
||||
{
|
||||
count += ns->Symbols.Symbols.CountUsed();
|
||||
delete ns;
|
||||
ns->Symbols.ReleaseSymbols();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
@ -550,7 +553,6 @@ int FNamespaceManager::RemoveSymbols()
|
|||
|
||||
void RemoveUnusedSymbols()
|
||||
{
|
||||
// Global symbols are not needed anymore after running the compiler.
|
||||
int count = Namespaces.RemoveSymbols();
|
||||
|
||||
// We do not need any non-field and non-function symbols in structs and classes anymore.
|
||||
|
|
Loading…
Reference in a new issue