From 6179361ff3d4f22a2cbb83895768392556093362 Mon Sep 17 00:00:00 2001 From: kramm Date: Wed, 12 Mar 2008 19:11:20 +0000 Subject: [PATCH] fixed a mem leak --- lib/gfxfont.c | 4 ++++ lib/pdf/InfoOutputDev.cc | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/gfxfont.c b/lib/gfxfont.c index 85af571..263757f 100644 --- a/lib/gfxfont.c +++ b/lib/gfxfont.c @@ -508,6 +508,10 @@ void gfxfont_free(gfxfont_t*font) if(font->unicode2glyph) { free(font->unicode2glyph);font->unicode2glyph = 0; } + if(font->id) { + free((void*)font->id);font->id=0; + } + free(font); } diff --git a/lib/pdf/InfoOutputDev.cc b/lib/pdf/InfoOutputDev.cc index fd33452..7a42e73 100644 --- a/lib/pdf/InfoOutputDev.cc +++ b/lib/pdf/InfoOutputDev.cc @@ -31,8 +31,8 @@ InfoOutputDev::~InfoOutputDev() } id2font->killIter(&i); - delete id2font; - delete splash; + delete id2font;id2font=0; + delete splash;splash=0; } void FontInfo::grow(int size) { @@ -65,6 +65,7 @@ FontInfo::~FontInfo() glyphs[t]=0; } } + free(glyphs);glyphs=0; } GBool InfoOutputDev::upsideDown() {return gTrue;} GBool InfoOutputDev::useDrawChar() {return gTrue;} -- 1.7.10.4