Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package

void SkRefCnt::unref (  )  const [inline, inherited]

Decrement the reference count. If the reference count is 1 before the decrement, then call delete on the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.

Definition at line 58 of file SkRefCnt.h.

Referenced by SkBitmap::HeapAllocator::allocPixelRef(), SkRefCnt::safeUnref(), and SkAutoUnref::unref().

                       {
        SkASSERT(fRefCnt > 0);
        if (sk_atomic_dec(&fRefCnt) == 1) {
            fRefCnt = 1;    // so our destructor won't complain
            SkDELETE(this);
        }
    }


Generated by  Doxygen 1.6.0   Back to index