- 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:
Christoph Oelckers 2017-01-12 22:49:18 +01:00
commit 7b7623d2c4
58 changed files with 175 additions and 154 deletions

View file

@ -45,7 +45,7 @@ public:
DScroller (EScroll type, double dx, double dy, int control, int affectee, int accel, EScrollPos scrollpos = EScrollPos::scw_all);
DScroller (double dx, double dy, const line_t *l, int control, int accel, EScrollPos scrollpos = EScrollPos::scw_all);
void Destroy() override;
void OnDestroy() override;
void Serialize(FSerializer &arc);
void Tick ();
@ -306,7 +306,7 @@ DScroller::DScroller (EScroll type, double dx, double dy,
}
}
void DScroller::Destroy ()
void DScroller::OnDestroy ()
{
for(int i=0;i<3;i++)
{
@ -316,7 +316,7 @@ void DScroller::Destroy ()
m_Interpolations[i] = NULL;
}
}
Super::Destroy();
Super::OnDestroy();
}
//-----------------------------------------------------------------------------