- split DObject::Destroy into the main method, a native OnDestroy and a scripted OnDestroy method and made the main method non-virtual
This was done to ensure it can be properly overridden in scripts without causing problems when called during engine shutdown for the type and symbol objects the VM needs to work and to have the scripted version always run first. Since the scripted OnDestroy method never calls the native version - the native one is run after the scripted one - this can be simply skipped over during shutdown.
This commit is contained in:
parent
0b94d4e0a3
commit
7b7623d2c4
58 changed files with 175 additions and 154 deletions
|
|
@ -103,7 +103,7 @@ protected:
|
|||
char savegamestring[SAVESTRINGSIZE];
|
||||
|
||||
DLoadSaveMenu(DMenu *parent = NULL, FListMenuDescriptor *desc = NULL);
|
||||
void Destroy() override;
|
||||
void OnDestroy() override;
|
||||
|
||||
int RemoveSaveSlot (int index);
|
||||
void UnloadSaveData ();
|
||||
|
|
@ -461,12 +461,12 @@ DLoadSaveMenu::DLoadSaveMenu(DMenu *parent, FListMenuDescriptor *desc)
|
|||
commentBottom = commentTop + commentHeight;
|
||||
}
|
||||
|
||||
void DLoadSaveMenu::Destroy()
|
||||
void DLoadSaveMenu::OnDestroy()
|
||||
{
|
||||
if (currentSavePic != nullptr) delete currentSavePic;
|
||||
currentSavePic = nullptr;
|
||||
ClearSaveStuff ();
|
||||
Super::Destroy();
|
||||
Super::OnDestroy();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
@ -928,7 +928,7 @@ class DSaveMenu : public DLoadSaveMenu
|
|||
public:
|
||||
|
||||
DSaveMenu(DMenu *parent = NULL, FListMenuDescriptor *desc = NULL);
|
||||
void Destroy() override;
|
||||
void OnDestroy() override;
|
||||
void DoSave (FSaveGameNode *node);
|
||||
bool Responder (event_t *ev);
|
||||
bool MenuEvent (int mkey, bool fromcontroller);
|
||||
|
|
@ -968,7 +968,7 @@ DSaveMenu::DSaveMenu(DMenu *parent, FListMenuDescriptor *desc)
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
void DSaveMenu::Destroy()
|
||||
void DSaveMenu::OnDestroy()
|
||||
{
|
||||
if (SaveGames[0] == &NewSaveNode)
|
||||
{
|
||||
|
|
@ -976,7 +976,7 @@ void DSaveMenu::Destroy()
|
|||
if (Selected == 0) Selected = -1;
|
||||
else Selected--;
|
||||
}
|
||||
Super::Destroy();
|
||||
Super::OnDestroy();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue