summaryrefslogtreecommitdiff
path: root/samples/pdfium_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r--samples/pdfium_test.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index d7648f6bde..37e36d322d 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -1564,14 +1564,14 @@ int main(int argc, const char* argv[]) {
}
#ifdef PDF_ENABLE_V8
- v8::Platform* platform;
+ std::unique_ptr<v8::Platform> platform;
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
v8::StartupData natives;
v8::StartupData snapshot;
- InitializeV8ForPDFium(options.exe_path, options.bin_directory, &natives,
- &snapshot, &platform);
+ platform = InitializeV8ForPDFium(options.exe_path, options.bin_directory,
+ &natives, &snapshot);
#else // V8_USE_EXTERNAL_STARTUP_DATA
- InitializeV8ForPDFium(options.exe_path, &platform);
+ platform = InitializeV8ForPDFium(options.exe_path);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // PDF_ENABLE_V8
@@ -1638,7 +1638,6 @@ int main(int argc, const char* argv[]) {
FPDF_DestroyLibrary();
#ifdef PDF_ENABLE_V8
v8::V8::ShutdownPlatform();
- delete platform;
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
free(const_cast<char*>(natives.data));