0

Destroy library before deleting g_font_info in ShutdownSDK()

FPDF_DestroyLibrary() will eventually call Release on the default
sysfontinfo. Also, should not try to delete this from the metrics
sysfontinfo, as that is what is done in FPDF_FreeDefault...()

BUG=664072

Review-Url: https://codereview.chromium.org/2493603003
Cr-Commit-Position: refs/heads/master@{#431319}
This commit is contained in:
npm
2016-11-10 11:42:41 -08:00
committed by Commit bot
parent 23ce0eee34
commit d7e4f1d73f

@ -320,7 +320,9 @@ struct FPDF_SYSFONTINFO_WITHMETRICS : public FPDF_SYSFONTINFO {
default_sysfontinfo = sysfontinfo;
}
~FPDF_SYSFONTINFO_WITHMETRICS() { delete default_sysfontinfo; }
~FPDF_SYSFONTINFO_WITHMETRICS() {
FPDF_FreeDefaultSystemFontInfo(default_sysfontinfo);
}
FPDF_SYSFONTINFO* default_sysfontinfo;
};
@ -651,11 +653,10 @@ bool InitializeSDK() {
}
void ShutdownSDK() {
FPDF_DestroyLibrary();
#if !defined(OS_LINUX)
FPDF_FreeDefaultSystemFontInfo(g_font_info->default_sysfontinfo);
delete g_font_info;
#endif
FPDF_DestroyLibrary();
TearDownV8();
}