Example #1
0
void AmSafeDelete::Delete()
{
	if (fRefCount <= 0) {
		// If nobody else has a reference on this event, it is
		// safe to just delete it.
		RealDelete();
	} else {
		// Otherwise, set the mDeleted flag, avoiding any race
		// conditions with other threads that might have references.
		IncRefs();
		fDeleted = 1;
		DecRefs();
	}
}
Example #2
0
void __fastcall DZRawData::Release(void)
{
    if (imp)
    {
        if (!DecRefs())
        {
			/*void*/char *_imp = (char*)imp;
            imp = NULL;
//            free(_imp);
			delete[] _imp;
        }
        imp = NULL;
    }
}
Example #3
0
void AmSafeDelete::Undelete()
{
	IncRefs();
	fDeleted = 0;
	DecRefs();
}