Browse Source

cktdest.c, xspice, set g_mif_info.ckt = NULL

when destroying/remcirc'ing a circuit

to avoid a crash in EVTfindvec()
  which might try to access fields in the destroyed CKTcircuit

( excercise: tran, remcirc, load rawfile, plot something_nonexistant )
pre-master-46
h_vogt 10 years ago
committed by rlar
parent
commit
236b99f2b1
  1. 6
      src/spicelib/analysis/cktdest.c

6
src/spicelib/analysis/cktdest.c

@ -17,6 +17,7 @@ Author: 1985 Thomas L. Quarles
#ifdef XSPICE
#include "ngspice/evtproto.h"
#include "ngspice/mif.h"
#endif
int
@ -77,5 +78,10 @@ CKTdestroy(CKTcircuit *ckt)
nghash_free(ckt->DEVnameHash, NULL, NULL);
nghash_free(ckt->MODnameHash, NULL, NULL);
FREE(ckt);
#ifdef XSPICE
g_mif_info.ckt = NULL;
#endif
return(OK);
}
Loading…
Cancel
Save