Make GrGpuGL release its resources before GrGLInterface is released.
Forward declare GrGLInterface in GrGLDefaultInterface_none file

Review URL: http://codereview.appspot.com/5030049/


git-svn-id: http://skia.googlecode.com/svn/trunk@2278 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLDefaultInterface_none.cpp b/gpu/src/GrGLDefaultInterface_none.cpp
index b6308e3..b487d53 100644
--- a/gpu/src/GrGLDefaultInterface_none.cpp
+++ b/gpu/src/GrGLDefaultInterface_none.cpp
@@ -6,6 +6,7 @@
  * found in the LICENSE file.
  */
 
+struct GrGLinterface;
 
 const GrGLInterface* GrGLDefaultInterface() {
     return NULL;
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index 92d836d..fefc914 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -541,6 +541,9 @@
 }
 
 GrGpuGL::~GrGpuGL() {
+    // This subclass must do this before the base class destructor runs
+    // since we will unref the GrGLInterface.
+    this->releaseResources();
     fGL->unref();
 }