- disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.

Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
This commit is contained in:
Christoph Oelckers 2016-11-24 21:36:02 +01:00
commit 66d28a24b8
149 changed files with 727 additions and 759 deletions

View file

@ -61,7 +61,7 @@ ClassReg DObject::RegistrationInfo =
nullptr, // MyClass
"DObject", // Name
nullptr, // ParentType
&DVMObject<DObject>::RegistrationInfo, // VMExport
nullptr,
nullptr, // Pointers
&DObject::InPlaceConstructor, // ConstructNative
nullptr,
@ -358,7 +358,6 @@ void DObject::Destroy ()
DEFINE_ACTION_FUNCTION(DObject, Destroy)
{
PARAM_SELF_PROLOGUE(DObject);
self->VMSuperCall();
self->Destroy();
return 0;
}