|
1 | 1 | diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp |
2 | | -index 2f7e5b1f2..22de37800 100644 |
| 2 | +index 499e70e36..3b943240f 100644 |
3 | 3 | --- a/fpdfsdk/fpdf_view.cpp |
4 | 4 | +++ b/fpdfsdk/fpdf_view.cpp |
5 | 5 | @@ -61,6 +61,9 @@ |
@@ -47,27 +47,22 @@ index 2f7e5b1f2..22de37800 100644 |
47 | 47 | FX_InitializeMemoryAllocators(); |
48 | 48 | CFX_Timer::InitializeGlobals(); |
49 | 49 | CFX_GEModule::Create(config ? config->m_pUserFontPaths : nullptr); |
50 | | -@@ -239,14 +263,12 @@ FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* config) { |
| 50 | +@@ -246,11 +270,9 @@ FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* config) { |
51 | 51 | CPDFXFA_ModuleInit(); |
52 | 52 | #endif // PDF_ENABLE_XFA |
53 | 53 |
|
54 | 54 | - if (config && config->version >= 2) { |
55 | 55 | - void* platform = config->version >= 3 ? config->m_pPlatform : nullptr; |
56 | 56 | - IJS_Runtime::Initialize(config->m_v8EmbedderSlot, config->m_pIsolate, |
57 | 57 | - platform); |
| 58 | +- } |
58 | 59 | +#if PDF_ENABLE_V8 |
59 | 60 | + IJS_Runtime::Initialize(0, g_isolate, g_platform); |
60 | 61 | +#endif // PDF_ENABLE_V8 |
61 | 62 |
|
62 | | -- if (config->version >= 4) { |
63 | | -- SetRendererType(config->m_RendererType); |
64 | | -- } |
65 | | -+ if (config && config->version >= 4) { |
66 | | -+ SetRendererType(config->m_RendererType); |
67 | | - } |
68 | | - g_bLibraryInitialized = true; |
69 | | - } |
70 | | -@@ -274,6 +296,19 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { |
| 63 | + if (config && config->version >= 4) { |
| 64 | + SetRendererType(config->m_RendererType); |
| 65 | +@@ -282,6 +304,19 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { |
71 | 66 | CFX_Timer::DestroyGlobals(); |
72 | 67 | FX_DestroyMemoryAllocators(); |
73 | 68 |
|
|
0 commit comments