diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index edf45b8f51..f91f4206c2 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -246,7 +246,6 @@ GrStencilBuffer* GrContext::findAndLockStencilBuffer(int width, int height, } void GrContext::unlockStencilBuffer(GrStencilBuffer* sb) { - ASSERT_OWNED_RESOURCE(sb); if (NULL == sb->getCacheEntry()) { // This can happen when the GrResourceCache is being deleted. If @@ -256,6 +255,10 @@ void GrContext::unlockStencilBuffer(GrStencilBuffer* sb) { return; } + // If the texture cache still exists we know the GrGpu & GrContext still + // exist so we can verify ownership. + ASSERT_OWNED_RESOURCE(sb); + fTextureCache->unlock(sb->getCacheEntry()); }