forked from Mirrors/openclonk
Fix unloading scenarios with Map.c or System.ocg scripts (#1778)
Destruction order matters!qteditor
parent
4725043493
commit
dcd8d9676a
|
@ -578,6 +578,7 @@ void C4Game::Clear()
|
|||
// Clear the particles before cleaning up the objects.
|
||||
Particles.Clear();
|
||||
DeleteObjects(true);
|
||||
::MapScript.Clear();
|
||||
::Definitions.Clear();
|
||||
Landscape.Clear();
|
||||
PXS.Clear();
|
||||
|
@ -589,7 +590,6 @@ void C4Game::Clear()
|
|||
Info.Clear();
|
||||
Title.Clear();
|
||||
pScenarioObjectsScript = NULL;
|
||||
::MapScript.Clear();
|
||||
::GameScript.Clear();
|
||||
Names.Clear();
|
||||
GameText.Clear();
|
||||
|
|
|
@ -703,9 +703,9 @@ bool C4MapScriptHost::LoadData(const char * f, const char * d, C4LangStringTable
|
|||
|
||||
void C4MapScriptHost::Clear()
|
||||
{
|
||||
C4ScriptHost::Clear();
|
||||
delete LayerPrototype; delete MapPrototype;
|
||||
LayerPrototype = MapPrototype = NULL;
|
||||
C4ScriptHost::Clear();
|
||||
}
|
||||
|
||||
C4PropListStatic * C4MapScriptHost::GetPropList()
|
||||
|
|
|
@ -229,8 +229,14 @@ C4ExtraScriptHost::C4ExtraScriptHost(C4String *parent_key_name):
|
|||
{
|
||||
}
|
||||
|
||||
C4ExtraScriptHost::~C4ExtraScriptHost()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void C4ExtraScriptHost::Clear()
|
||||
{
|
||||
C4ScriptHost::Clear();
|
||||
ParserPropList._getPropList()->Clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ class C4ExtraScriptHost: public C4ScriptHost
|
|||
C4Value ParserPropList;
|
||||
public:
|
||||
C4ExtraScriptHost(C4String *parent_key_name = NULL);
|
||||
~C4ExtraScriptHost();
|
||||
void Clear();
|
||||
|
||||
bool Delete() { return true; }
|
||||
|
|
Loading…
Reference in New Issue