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

Side by Side Diff: samples/pdfium_test.cc

Issue 1410333007: Fix i#263: memory leaks from RenderPdf (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: update commit message Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> 5 #include <limits.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (FPDFAvail_IsLinearized(pdf_avail)) { 478 if (FPDFAvail_IsLinearized(pdf_avail)) {
479 fprintf(stderr, "Linearized path...\n"); 479 fprintf(stderr, "Linearized path...\n");
480 doc = FPDFAvail_GetDocument(pdf_avail, nullptr); 480 doc = FPDFAvail_GetDocument(pdf_avail, nullptr);
481 } else { 481 } else {
482 fprintf(stderr, "Non-linearized path...\n"); 482 fprintf(stderr, "Non-linearized path...\n");
483 doc = FPDF_LoadCustomDocument(&file_access, nullptr); 483 doc = FPDF_LoadCustomDocument(&file_access, nullptr);
484 } 484 }
485 485
486 if (!doc) { 486 if (!doc) {
487 fprintf(stderr, "Load pdf docs unsuccessful.\n"); 487 fprintf(stderr, "Load pdf docs unsuccessful.\n");
488 FPDFAvail_Destroy(pdf_avail);
488 return; 489 return;
489 } 490 }
490 491
491 (void)FPDF_GetDocPermissions(doc); 492 (void)FPDF_GetDocPermissions(doc);
492 (void)FPDFAvail_IsFormAvail(pdf_avail, &hints); 493 (void)FPDFAvail_IsFormAvail(pdf_avail, &hints);
493 494
494 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); 495 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks);
495 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD); 496 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD);
496 FPDF_SetFormFieldHighlightAlpha(form, 100); 497 FPDF_SetFormFieldHighlightAlpha(form, 100);
497 498
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 658 }
658 659
659 FPDF_DestroyLibrary(); 660 FPDF_DestroyLibrary();
660 #ifdef PDF_ENABLE_V8 661 #ifdef PDF_ENABLE_V8
661 v8::V8::ShutdownPlatform(); 662 v8::V8::ShutdownPlatform();
662 delete platform; 663 delete platform;
663 #endif // PDF_ENABLE_V8 664 #endif // PDF_ENABLE_V8
664 665
665 return 0; 666 return 0;
666 } 667 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698