Fixed assert in unlockStencilBuffer
http://codereview.appspot.com/6492088/
git-svn-id: http://skia.googlecode.com/svn/trunk@5413 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index edf45b8..f91f420 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -246,7 +246,6 @@
}
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 @@
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());
}