From 236b99f2b1824869dba3cd7b7b076820817f01fd Mon Sep 17 00:00:00 2001 From: h_vogt Date: Wed, 1 Jun 2016 00:43:09 +0200 Subject: [PATCH] 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 ) --- src/spicelib/analysis/cktdest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/spicelib/analysis/cktdest.c b/src/spicelib/analysis/cktdest.c index b2c5331f9..338ca71d8 100644 --- a/src/spicelib/analysis/cktdest.c +++ b/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); }