fixed a mem leak
authorkramm <kramm>
Wed, 12 Mar 2008 19:11:20 +0000 (19:11 +0000)
committerkramm <kramm>
Wed, 12 Mar 2008 19:11:20 +0000 (19:11 +0000)
lib/gfxfont.c
lib/pdf/InfoOutputDev.cc

index 85af571..263757f 100644 (file)
@@ -508,6 +508,10 @@ void gfxfont_free(gfxfont_t*font)
     if(font->unicode2glyph) {
        free(font->unicode2glyph);font->unicode2glyph = 0;
     }
     if(font->unicode2glyph) {
        free(font->unicode2glyph);font->unicode2glyph = 0;
     }
+    if(font->id) {
+       free((void*)font->id);font->id=0;
+    }
+
     free(font);
 }
 
     free(font);
 }
 
index fd33452..7a42e73 100644 (file)
@@ -31,8 +31,8 @@ InfoOutputDev::~InfoOutputDev()
     }
     id2font->killIter(&i);
 
     }
     id2font->killIter(&i);
 
-    delete id2font;
-    delete splash;
+    delete id2font;id2font=0;
+    delete splash;splash=0;
 }
 void FontInfo::grow(int size)
 {
 }
 void FontInfo::grow(int size)
 {
@@ -65,6 +65,7 @@ FontInfo::~FontInfo()
            glyphs[t]=0;
        }
     }
            glyphs[t]=0;
        }
     }
+    free(glyphs);glyphs=0;
 }
 GBool InfoOutputDev::upsideDown() {return gTrue;}
 GBool InfoOutputDev::useDrawChar() {return gTrue;}
 }
 GBool InfoOutputDev::upsideDown() {return gTrue;}
 GBool InfoOutputDev::useDrawChar() {return gTrue;}