inline SQInteger DefSQConstructorCallback(HSQUIRRELVM vm) { /* Find the amount of params we got */ int nparam = sq_gettop(vm); try { /* Create the real instance */ Tcls *instance = HelperT<Tmethod>::SQConstruct((Tcls *)NULL, (Tmethod)NULL, vm); sq_setinstanceup(vm, -Tnparam, instance); sq_setreleasehook(vm, -Tnparam, DefSQDestructorCallback<Tcls>); instance->AddRef(); return 0; } catch (SQInteger e) { sq_pop(vm, nparam); return e; } }
/** add one ref to the underlaying object */ FORCEINLINE void AddRef() {if (m_pT != NULL) m_pT->AddRef();}
/** add one ref to the underlaying object */ inline void AddRef() { if (m_pT != NULL) m_pT->AddRef(); }