diff options
author | kramm <kramm> | 2008-03-19 21:50:04 +0000 |
---|---|---|
committer | kramm <kramm> | 2008-03-19 21:50:04 +0000 |
commit | 2256dc75677d29b2821fccafdd16d5e8eb27ce12 (patch) | |
tree | 16fe6cfec01f6c1bb9b1d442da9991ec9977340e /lib/pdf/pdf.cc | |
parent | 6224775ba4774f77854d1ac0f7e74b4a22eba13f (diff) |
fixed mem leak
Diffstat (limited to 'lib/pdf/pdf.cc')
-rw-r--r-- | lib/pdf/pdf.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index c828f02d..f651e58a 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -22,6 +22,8 @@ static char* global_page_range = 0; static parameter_t* device_config = 0; static parameter_t* device_config_next = 0; +static int globalparams_count=0; + typedef struct _pdf_page_info { int xMin, yMin, xMax, yMax; @@ -133,8 +135,6 @@ void pdfpage_rendersection(gfxpage_t*page, gfxdevice_t*output, gfxcoord_t x, gfx render2(page, output); } -static int globalparams_count=0; - void pdf_doc_destroy(gfxdocument_t*gfx) { pdf_doc_internal_t*i= (pdf_doc_internal_t*)gfx->internal; @@ -480,6 +480,14 @@ void pdf_destroy(gfxsource_t*src) return; gfxsource_internal_t*i = (gfxsource_internal_t*)src->internal; free(src->internal);src->internal=0; + + parameter_t*p = device_config; + while(p) { + parameter_t*next = p->next; + p->next = 0;free(p); + p = next; + } + delete globalParams;globalParams = 0; } gfxsource_t*gfxsource_pdf_create() |