Пример #1
0
	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;
		}
	}
Пример #2
0
	/** add one ref to the underlaying object */
	FORCEINLINE void AddRef() {if (m_pT != NULL) m_pT->AddRef();}
Пример #3
0
	/** add one ref to the underlaying object */
	inline void AddRef()
	{
		if (m_pT != NULL) m_pT->AddRef();
	}