Tear down Gr stuff before GL context in SampleApp
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 10 Apr 2012 15:56:29 +0000 (15:56 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 10 Apr 2012 15:56:29 +0000 (15:56 +0000)
Review URL: http://codereview.appspot.com/6000043/

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

samplecode/SampleApp.cpp

index 3ab9e89..1d50b5c 100644 (file)
@@ -224,8 +224,6 @@ public:
     }
 
     virtual void tearDownBackend(SampleWindow *win) {
-        win->detach();
-        fBackend = kNone_BackEndType;
 
         SkSafeUnref(fCurContext);
         fCurContext = NULL;
@@ -235,6 +233,9 @@ public:
 
         SkSafeUnref(fCurRenderTarget);
         fCurRenderTarget = NULL;
+
+        win->detach();
+        fBackend = kNone_BackEndType;
     }
 
     virtual bool prepareCanvas(SampleWindow::DeviceType dType,