Fix graphical corruption due to tear down race

 Bug: 9278945

Change-Id: I7594680322768f60eaed8a1037d139cbadf9706b
diff --git a/src/com/android/gallery3d/ui/GLRootView.java b/src/com/android/gallery3d/ui/GLRootView.java
index f00bd54..dc898d8 100644
--- a/src/com/android/gallery3d/ui/GLRootView.java
+++ b/src/com/android/gallery3d/ui/GLRootView.java
@@ -409,6 +409,9 @@
         rotateCanvas(-mCompensation);
         if (mContentView != null) {
            mContentView.render(mCanvas);
+        } else {
+            // Make sure we always draw something to prevent displaying garbage
+            mCanvas.clearBuffer();
         }
         mCanvas.restore();