From fedda1d8df2fe1de97d5cdffd96a76e7530976a6 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 22 Sep 2015 16:08:39 -0700 Subject: [PATCH] Fix leak of the picture after tracing it to a file --- sky/compositor/paint_context.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sky/compositor/paint_context.cc b/sky/compositor/paint_context.cc index f2e35cbeb8a..a80074804e7 100644 --- a/sky/compositor/paint_context.cc +++ b/sky/compositor/paint_context.cc @@ -86,8 +86,9 @@ PaintContext::ScopedFrame::~ScopedFrame() { context_.endFrame(*this); if (trace_file_name_.length() > 0) { - auto picture = trace_recorder_->endRecordingAsPicture(); + SkPicture* picture = trace_recorder_->endRecordingAsPicture(); SerializePicture(trace_file_name_.c_str(), picture); + picture->unref(); } }