From 3f7201376c04b4d4a07517999da0fc1f117fb266 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 5 Apr 2009 18:31:25 +0000 Subject: [PATCH] call to nupa_done() to release memory --- ChangeLog | 6 ++++-- src/frontend/numparam/spicenum.c | 2 +- src/frontend/subckt.c | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1dc7d4e9..972825ca6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,10 @@ * com_fft.c, inpcom.c, variable.c, variable.h, resource.c, cpitf.c, plotit.c, inpgtok.c: some more memory leaks removed - spicenum.c: release of memory for dico->dyncategory corrected - subckt.c, inp.c, inpcom.c more on memory leaks + * spicenum.c: release of memory for dico->dyncategory corrected + * subckt.c, inp.c, inpcom.c: more on memory leaks + * subckt.c, spicenum.c: make call to fcn nupa_done() at the end of + fcn inp_subcktexpand() to clear memory. 2009-04-01 Dietmar Warning * frontend/resource.c, misc/misc_time.c: init of rusage structure to prevent diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 22d7d7003..319652220 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -630,7 +630,7 @@ nupa_copy (char *s, int linenum) pscopy (u, s, 1, ls); /* strip trailing space, CrLf and so on */ dico->srcline = linenum; - if ((!inexpansion) && (linenum >= 0) && (linenum < dynmaxline)) + if ((!inexpansion) && (linenum >= 0) && (linenum <= dynmaxline)) { linecount++; dico->dynrefptr[linenum] = s; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 3e2c30ac2..b874c76dc 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -184,7 +184,7 @@ inp_subcktexpand(struct line *deck) c= c->li_next; } c=deck; - while ( c != NULL) { /* first Numparam pass */ + while ( c != NULL) { /* first Numparam pass */ c->li_line = nupa_copy(c->li_line, c->li_linenum); c= c->li_next; } @@ -344,9 +344,10 @@ inp_subcktexpand(struct line *deck) c= c->li_next; } #endif /* TRACE */ - //ok= ok && nupa_signal(NUPAEVALDONE, NULL); + //nupa_list_params(stdout); nupa_copy_inst_dico(); + ok= ok && nupa_signal(NUPAEVALDONE, NULL); } return (ll); /* return the spliced deck. */ }