Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3399)

Unified Diff: chrome/renderer/print_web_view_helper_linux.cc

Issue 7585012: Fix print preview draft page memory leaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed one on Mac. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 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 c9d8f38f760d62a07d0485c7312a2a300f5b253a..771d37b7de8de4778891eed1b2918e5c3ad7fc0f 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,
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698