diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index 74cf70263..b36ab7125 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -1111,6 +1111,11 @@ void plot_setcur(const char *name) else if (cieq(name, "previous")) { if (plot_cur->pl_next) { plot_cur = plot_cur->pl_next; +#ifdef XSPICE + if (ft_curckt) { + EVTswitch_plot(ft_curckt->ci_ckt, plot_cur->pl_typename); + } +#endif } else { fprintf(cp_err, @@ -1131,7 +1136,11 @@ void plot_setcur(const char *name) } if (prev_pl) { /* found */ plot_cur = prev_pl; - EVTswitch_plot(ft_curckt->ci_ckt, plot_cur->pl_typename); +#ifdef XSPICE + if (ft_curckt) { + EVTswitch_plot(ft_curckt->ci_ckt, plot_cur->pl_typename); + } +#endif } else { /* no next plot */ fprintf(cp_err, @@ -1156,7 +1165,14 @@ void plot_setcur(const char *name) plot_cur->pl_ccom = cp_kwswitch(CT_VECTOR, pl->pl_ccom); } */ - EVTswitch_plot(ft_curckt->ci_ckt, name); +#ifdef XSPICE + /* XSPICE event data are linked to the current circuit. It must not be removed + when manipulating the data by any command. + */ + if (ft_curckt) { + EVTswitch_plot(ft_curckt->ci_ckt, name); + } +#endif plot_cur = pl; } /* end of function plot_setcur */ diff --git a/src/xspice/evt/evtsetup.c b/src/xspice/evt/evtsetup.c index ed1a658e4..5540d64c5 100644 --- a/src/xspice/evt/evtsetup.c +++ b/src/xspice/evt/evtsetup.c @@ -617,7 +617,9 @@ int EVTsetup_plot(CKTcircuit* ckt, char *plotname) { } /* If command 'setplot' is called, we switch to the corresponding event data. - Their pointers have been stored in the jobs structure.*/ + Their pointers have been stored in the jobs structure. The circuit must + be still available! +*/ int EVTswitch_plot(CKTcircuit* ckt, const char* plottypename) { int i; bool found = FALSE;