Fixed memory leak in deferred_canvas_record bench
http://codereview.appspot.com/6499123/
git-svn-id: http://skia.googlecode.com/svn/trunk@5564 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/DeferredCanvasBench.cpp b/bench/DeferredCanvasBench.cpp
index 15902b9..a1a3901 100644
--- a/bench/DeferredCanvasBench.cpp
+++ b/bench/DeferredCanvasBench.cpp
@@ -26,8 +26,12 @@
}
virtual void onDraw(SkCanvas* canvas) {
- SkDeferredCanvas deferredCanvas(canvas->getDevice()->createCompatibleDevice(
- SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false));
+ SkDevice *device = canvas->getDevice()->createCompatibleDevice(
+ SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false);
+
+ SkDeferredCanvas deferredCanvas(device);
+
+ device->unref();
initDeferredCanvas(deferredCanvas);