--- gnuplot/src/plot2d.c 2007-03-29 14:28:26.000000000 -0700 +++ gnuplot-cvs/src/plot2d.c 2007-04-08 17:51:07.000000000 -0700 @@ -1309,10 +1309,16 @@ uses_axis[SECOND_X_AXIS] = uses_axis[SECOND_Y_AXIS] = 0; + /* Original Comment follows: */ /* Reset first_plot. This is usually done at the end of this function. * If there is an error within this function, the memory is left allocated, * since we cannot call cp_free if the list is incomplete. Making sure that * the list structure is always valid requires some rewriting */ + /* EAM Apr 2007 - but we need to keep the previous structures around in + * order to be able to replot/zoom them without re-reading all the data. + */ + if (first_plot) + cp_free(first_plot); first_plot = NULL; tp_ptr = &(first_plot); @@ -2222,10 +2228,6 @@ } } } /* some_functions */ - /* throw out all curve_points at end of list, that we don't need */ - cp_free(*tp_ptr); - *tp_ptr = NULL; - /* if first_plot is NULL, we have no functions or data at all. This can * happen, if you type "plot x=5", since x=5 is a variable assignment */ @@ -2337,8 +2339,6 @@ update_gpval_variables(1); } - cp_free(first_plot); - first_plot = NULL; } /* eval_plots */