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

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: 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.cpp » ('j') | testing/embedder_test.cpp » ('J')
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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 } 832 }
833 } 833 }
834 } 834 }
835 RenderPdf(filename, file_contents.get(), file_length, options, events); 835 RenderPdf(filename, file_contents.get(), file_length, options, events);
836 } 836 }
837 837
838 FPDF_DestroyLibrary(); 838 FPDF_DestroyLibrary();
839 #ifdef PDF_ENABLE_V8 839 #ifdef PDF_ENABLE_V8
840 v8::V8::ShutdownPlatform(); 840 v8::V8::ShutdownPlatform();
841 delete platform; 841 delete platform;
842
843 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
844 free(const_cast<char*>(natives.data));
845 free(const_cast<char*>(snapshot.data));
846 #endif // V8_USE_EXTERNAL_STARTUP_DATA
842 #endif // PDF_ENABLE_V8 847 #endif // PDF_ENABLE_V8
843 848
844 return 0; 849 return 0;
845 } 850 }
OLDNEW
« no previous file with comments | « no previous file | testing/embedder_test.cpp » ('j') | testing/embedder_test.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698