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

Side by Side Diff: samples/pdfium_test.cc

Issue 2068563002: Fix memory leaks with V8 startup data. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix non-V8 builds Created 4 years, 6 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 | testing/embedder_test.h » ('j') | 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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 } 875 }
876 } 876 }
877 } 877 }
878 RenderPdf(filename, file_contents.get(), file_length, options, events); 878 RenderPdf(filename, file_contents.get(), file_length, options, events);
879 } 879 }
880 880
881 FPDF_DestroyLibrary(); 881 FPDF_DestroyLibrary();
882 #ifdef PDF_ENABLE_V8 882 #ifdef PDF_ENABLE_V8
883 v8::V8::ShutdownPlatform(); 883 v8::V8::ShutdownPlatform();
884 delete platform; 884 delete platform;
885
886 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
887 free(const_cast<char*>(natives.data));
888 free(const_cast<char*>(snapshot.data));
889 #endif // V8_USE_EXTERNAL_STARTUP_DATA
885 #endif // PDF_ENABLE_V8 890 #endif // PDF_ENABLE_V8
886 891
887 return 0; 892 return 0;
888 } 893 }
OLDNEW
« no previous file with comments | « no previous file | testing/embedder_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698