summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-17 19:50:19 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-17 19:50:19 -0800
commit8a4a693cb765538fab169f22d3f74716e6c67e36 (patch)
tree033224491909c56b767004cf4f04a5c7f322c16d /profile.c
parent4e5e87c51d19a7676c97b6e3b4a4b48147d1313b (diff)
downloadsubsurface-8a4a693cb765538fab169f22d3f74716e6c67e36.tar.gz
Don't use the same variable for new and old profile
This will make no difference when we remove the old profile, but for now I worry that this could cause us trouble. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/profile.c b/profile.c
index ba555e252..80fb0e016 100644
--- a/profile.c
+++ b/profile.c
@@ -20,7 +20,7 @@ char zoomed_plot = 0;
char dc_number = 0;
-static struct plot_data *last_pi_entry = NULL;
+static struct plot_data *last_pi_entry = NULL, *last_pi_entry_new = NULL;
#ifdef DEBUG_PI
/* debugging tool - not normally used */
@@ -1360,9 +1360,9 @@ struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, s
void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi)
{
init_decompression(dive);
- if (last_pi_entry) /* Create the new plot data */
- free((void *)last_pi_entry);
- last_pi_entry = populate_plot_entries(dive, dc, pi);
+ if (last_pi_entry_new) /* Create the new plot data */
+ free((void *)last_pi_entry_new);
+ last_pi_entry_new = populate_plot_entries(dive, dc, pi);
check_gas_change_events(dive, dc, pi); /* Populate the gas index from the gas change events */
setup_gas_sensor_pressure(dive, dc, pi); /* Try to populate our gas pressure knowledge */
populate_pressure_information(dive, dc, pi);/* .. calculate missing pressure entries */