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 )
This commit is contained in:
h_vogt 2016-06-01 00:43:09 +02:00 committed by rlar
parent 0252f7b9cb
commit 236b99f2b1
1 changed files with 6 additions and 0 deletions

View File

@ -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);
}