int asCScriptObject::Release() { // Clear the flag set by the GC gcFlag = false; // Call the script destructor behaviour if the reference counter is 1. if( refCount.get() == 1 && !isDestructCalled ) { CallDestructor(); } // Now do the actual releasing int r = refCount.atomicDec(); if( r == 0 ) { Destruct(); return 0; } return r; }
void SC_SequencedCommand::Delete() { CallDestructor(); World_Free(mWorld, this); }