diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-17 11:52:48 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-17 11:52:48 +0000 |
commit | bf3ef28f3bd86f2de488f03f1cd08b6e6203d479 (patch) | |
tree | 50cbf21e3aba18abc623a8e6f6ce85e6843b5683 | |
parent | 433ce5e6869d5937e31ff5f305be54092b37f2e4 (diff) |
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
-rw-r--r-- | bench/DeferredCanvasBench.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bench/DeferredCanvasBench.cpp b/bench/DeferredCanvasBench.cpp index 15902b9f58..a1a3901632 100644 --- a/bench/DeferredCanvasBench.cpp +++ b/bench/DeferredCanvasBench.cpp @@ -26,8 +26,12 @@ protected: } 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); |