Index: bench/ImageBench.cpp |
diff --git a/bench/ImageBench.cpp b/bench/ImageBench.cpp |
index 89fbcd6aeff48565cd9b163c4bcb13e43296e5d2..b81c57c6dcb09b8402a7b7bd394ae8f91e1976ee 100644 |
--- a/bench/ImageBench.cpp |
+++ b/bench/ImageBench.cpp |
@@ -39,6 +39,13 @@ protected: |
fRasterSurface.reset(SkSurface::NewRaster(info)); |
} |
+ void onPerCanvasPostDraw(SkCanvas*) override { |
+ // Release the image and raster surface here to prevent out of order destruction |
+ // between these and the gpu interface. |
+ fRasterSurface.reset(nullptr); |
+ fImage.reset(nullptr); |
+ } |
+ |
void onDraw(int loops, SkCanvas*) override { |
for (int i = 0; i < loops; i++) { |
for (int inner = 0; inner < 10; ++inner) { |