Index: src/gpu/GrRenderTarget.cpp |
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp |
index 090834912a5540754fc9199214e5223daa308fe4..5cb34e849aa1ed601fe908d7c201066aa554198d 100644 |
--- a/src/gpu/GrRenderTarget.cpp |
+++ b/src/gpu/GrRenderTarget.cpp |
@@ -18,7 +18,11 @@ |
void GrRenderTarget::discard() { |
// go through context so that all necessary flushing occurs |
GrContext* context = this->getContext(); |
- GrDrawContext* drawContext = context ? context->drawContext() : nullptr; |
+ if (!context) { |
+ return; |
+ } |
+ |
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); |
if (!drawContext) { |
jvanverth1
2015/09/01 14:43:37
Is this check still needed?
robertphillips
2015/09/01 14:49:04
Yep - the context could still be abandoned at this
|
return; |
} |