diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-06 03:19:59 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-06 03:19:59 +0000 |
commit | 519dd5c62b24e9bdea4d61e015060bef91c5edb5 (patch) | |
tree | f637d93e48b13f541bbca9e2be759a205df9a3bc /chrome/renderer/print_web_view_helper_linux.cc | |
parent | f7ece85cb9909c76eb344f2462bb7b6c55973d3f (diff) | |
download | chromium_src-519dd5c62b24e9bdea4d61e015060bef91c5edb5.zip chromium_src-519dd5c62b24e9bdea4d61e015060bef91c5edb5.tar.gz chromium_src-519dd5c62b24e9bdea4d61e015060bef91c5edb5.tar.bz2 |
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
Diffstat (limited to 'chrome/renderer/print_web_view_helper_linux.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper_linux.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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<printing::Metafile> page_metafile; if (print_preview_context_.IsModifiable()) { - page_metafile = reinterpret_cast<printing::PreviewMetafile*>( - print_preview_context_.metafile())->GetMetafileForCurrentPage(); + page_metafile.reset(reinterpret_cast<printing::PreviewMetafile*>( + print_preview_context_.metafile())->GetMetafileForCurrentPage()); } - PreviewPageRendered(page_number, page_metafile); + PreviewPageRendered(page_number, page_metafile.get()); } bool PrintWebViewHelper::PrintPages(const PrintMsg_PrintPages_Params& params, |