diff options
Diffstat (limited to 'samplecode/SampleApp.cpp')
| -rw-r--r-- | samplecode/SampleApp.cpp | 8 |
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; |
