From 519dd5c62b24e9bdea4d61e015060bef91c5edb5 Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Sat, 6 Aug 2011 03:19:59 +0000 Subject: Fix print preview draft page memory leaks. BUG=91862 TEST=NONE Review URL: http://codereview.chromium.org/7585012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95722 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/print_web_view_helper_linux.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/renderer/print_web_view_helper_linux.cc') diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc index c9d8f38..771d37b 100644 --- a/chrome/renderer/print_web_view_helper_linux.cc +++ b/chrome/renderer/print_web_view_helper_linux.cc @@ -38,12 +38,12 @@ void PrintWebViewHelper::RenderPreviewPage(int page_number) { print_preview_context_.RenderedPreviewPage( base::TimeTicks::Now() - begin_time); - printing::Metafile* page_metafile = NULL; + scoped_ptr page_metafile; if (print_preview_context_.IsModifiable()) { - page_metafile = reinterpret_cast( - print_preview_context_.metafile())->GetMetafileForCurrentPage(); + page_metafile.reset(reinterpret_cast( + print_preview_context_.metafile())->GetMetafileForCurrentPage()); } - PreviewPageRendered(page_number, page_metafile); + PreviewPageRendered(page_number, page_metafile.get()); } bool PrintWebViewHelper::PrintPages(const PrintMsg_PrintPages_Params& params, -- cgit v1.1