From ab303ef6e86089ae28f30a52149f1dae177e1468 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Mon, 28 May 2012 13:37:25 +0000 Subject: Speculative fix for Android Debug only crash in r4049 http://codereview.appspot.com/6251049/ git-svn-id: http://skia.googlecode.com/svn/trunk@4053 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/gpu/GrContext.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index c9c15dfcac..470741e7d5 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -857,8 +857,13 @@ public: } ~GrAutoScratchTexture() { + this->reset(); + } + + void reset() { if (NULL != fContext) { fContext->unlockTexture(fEntry); + fEntry.reset(); } } @@ -866,10 +871,8 @@ public: const GrTextureDesc& desc, GrContext::ScratchTexMatch match = GrContext::kApprox_ScratchTexMatch) { - if (NULL != fContext) { - fContext->unlockTexture(fEntry); - fEntry.reset(); - } + this->reset(); + fContext = context; if (NULL != fContext) { fEntry = fContext->lockScratchTexture(desc, match); -- cgit v1.2.3