I add new Font,and I found a memory leak.
As follow:
Code: Select all
bool
wxPdfFontSubsetCff::ReadFontDict(wxPdfCffDictionary* dict, int dictOffset, int dictSize)
{
bool ok = true;
SeekI(dictOffset);
int end = dictOffset + dictSize;
int argStart, argSize, argTotal, op;
while (TellI() < end)
{
argStart = TellI();
argTotal = 0;
do
{
argSize = ReadOperandLength();
argTotal += argSize;
SeekI(argStart + argTotal);
}
while (argSize > 0);
op = ReadOperator();
wxPdfCffDictElement* dictElement = new wxPdfCffDictElement(op, m_inFont, argStart, argTotal);
//add this code to check
if ((*dict).count(op)>0)
{
delete (*dict)[op];
}
(*dict)[op] = dictElement;
}
return ok;
}