summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-18 12:47:11 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-18 12:47:11 -0700
commit2c28619de8051661c7f66f2192c6fb9ef14ee905 (patch)
tree4bd15bf0bb72e4127403548bf2f40230bbdd352b /fpdfsdk/src/fpdfview.cpp
parent0c1bd7c6ad378ea97a2f54cb0c4761716f6d1057 (diff)
downloadpdfium-2c28619de8051661c7f66f2192c6fb9ef14ee905.tar.xz
Replace some Release() calls with virtual destructors.
Required fixing xfa-specific code. Original Review URL: https://codereview.chromium.org/1192013002. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1176413004.
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 80aad14ac2..227843ec5c 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -177,11 +177,11 @@ FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy)
return FALSE;
}
-CCodec_ModuleMgr* g_pCodecModule = NULL;
+CCodec_ModuleMgr* g_pCodecModule = nullptr;
DLLEXPORT void STDCALL FPDF_InitLibrary()
{
- g_pCodecModule = CCodec_ModuleMgr::Create();
+ g_pCodecModule = new CCodec_ModuleMgr();
CFX_GEModule::Create();
CFX_GEModule::Get()->SetCodecModule(g_pCodecModule);
@@ -199,7 +199,9 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary()
CPDFXFA_App::ReleaseInstance();
CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy();
- g_pCodecModule->Destroy();
+
+ delete g_pCodecModule;
+ g_pCodecModule = nullptr;
}
#ifndef _WIN32