summaryrefslogtreecommitdiffstats
path: root/core/profile.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-25 12:56:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-08-28 07:10:09 -0700
commit25b30da2446d9daf8343c246056b207d285582e7 (patch)
tree3b2b4d7e586530938c10c79fcba25b2e0524d8f6 /core/profile.h
parent0e55739f03d15b93a678e29bb1af26ff703f0c2f (diff)
downloadsubsurface-25b30da2446d9daf8343c246056b207d285582e7.tar.gz
Profile: properly initialize plot_info structures
The create_plot_info_new() function releases old plot data. This can only work if the plot_info structure was initialized previously. The ProfileWidget2 did that by a memset, but other parts of the code did not. Therefore, introduce a init_plot_info() function and call that when generating a plot_info struct. Constructors would make this so much easier - but since this is called from C, we can't use them. Fixes #2251 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/profile.h')
-rw-r--r--core/profile.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/profile.h b/core/profile.h
index 2c4a632d5..580fc8e68 100644
--- a/core/profile.h
+++ b/core/profile.h
@@ -80,6 +80,7 @@ struct ev_select {
extern void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int bufsize, int sum);
extern struct plot_info *analyze_plot_info(struct plot_info *pi);
+extern void init_plot_info(struct plot_info *pi);
extern void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi, bool fast, struct deco_state *planner_ds);
extern void calculate_deco_information(struct deco_state *ds, const struct deco_state *planner_de, const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi, bool print_mode);
extern struct plot_data *get_plot_details_new(struct plot_info *pi, int time, struct membuffer *);