That's good to know.
If you use inhereted reference_count then make sure to declare the AddRef and Release methods as virtual. And when registering these methods for the derived class make sure you take the address of the method as they appear in the derived class. Example:
class RefCount
{
public:
virtual void AddRef();
virtual void Release();
};
class Derived : public RefCount
{
public:
static void Register(asIScriptEngine *engine)
{
engine->RegisterObjectType("Derived", 0, asOBJ_REF);
engine->RegisterObectBehaviour("Derived", asBEHAVE_ADDREF, asMETHOD(Derived,AddRef), asCALL_THISCALL);
engine->RegisterObjectBehaviour("Derived", asBEHAVE_RELEASE, asMETHOD(Derived,Release), asCALL_THISCALL);
}
};
This will make sure that AngelScript use the correct object pointer when calling the class methods.
Regards,
Andreas