Exit ~GrContext early if GrContext::init() failed.
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Apr 2013 17:59:32 +0000 (17:59 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Apr 2013 17:59:32 +0000 (17:59 +0000)
Review URL: https://codereview.chromium.org/14049028

git-svn-id: http://skia.googlecode.com/svn/trunk@8841 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrContext.cpp

index ded4bc1..5d0465e 100644 (file)
@@ -140,6 +140,10 @@ GrContext::~GrContext() {
         (*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo);
     }
 
+    if (NULL == fGpu) {
+        return;
+    }
+
     this->flush();
 
     // Since the gpu can hold scratch textures, give it a chance to let go