diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-28 13:37:25 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-28 13:37:25 +0000 |
commit | ab303ef6e86089ae28f30a52149f1dae177e1468 (patch) | |
tree | bd2c0c733461afa351e704124a22d9f88feaa56c /include/gpu | |
parent | 2e0a061c091ae1f840267f8cb2e37c7817c8911f (diff) |
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
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrContext.h | 11 |
1 files changed, 7 insertions, 4 deletions
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); |