aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-10-30 11:29:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-30 11:29:08 -0700
commit789e327ad9c9f7d25b2368b4f3f9812bf9f0a3a2 (patch)
tree61dbf1f8f79d198f9febe4503eb518b8e8b48862 /samplecode
parent902d4d18dec27b6991516a235fc04a7af7290287 (diff)
tell our grcontext to abandon its backend
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleApp.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 1b4a55e5dd..3d2aa7c573 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -259,8 +259,12 @@ public:
virtual void tearDownBackend(SampleWindow *win) {
#if SK_SUPPORT_GPU
- SkSafeUnref(fCurContext);
- fCurContext = NULL;
+ if (fCurContext) {
+ // in case we have outstanding refs to this guy (lua?)
+ fCurContext->abandonContext();
+ fCurContext->unref();
+ fCurContext = NULL;
+ }
SkSafeUnref(fCurIntf);
fCurIntf = NULL;