aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-28 13:37:25 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-28 13:37:25 +0000
commitab303ef6e86089ae28f30a52149f1dae177e1468 (patch)
treebd2c0c733461afa351e704124a22d9f88feaa56c /include
parent2e0a061c091ae1f840267f8cb2e37c7817c8911f (diff)
Speculative fix for Android Debug only crash in r4049
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h11
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);