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

Unified Diff: chrome/renderer/print_web_view_helper_win.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 | « chrome/renderer/print_web_view_helper_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper_win.cc
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index 9cd72ece67ff9817f5dae4897f8cb6dcdcbcde7a..edaaf8f27391e391fcf20501d54811b80d14c7f6 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -140,12 +140,12 @@ void PrintWebViewHelper::RenderPreviewPage(int page_number) {
// Release since |print_preview_context_| is the real owner.
metafile.release();
- 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());
}
void PrintWebViewHelper::RenderPage(
« no previous file with comments | « chrome/renderer/print_web_view_helper_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698