mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: call calculate_max_limits_new() in create_plot_info_new()
All callers of create_plot_info_new() called calculate_max_limits_new() a line before. Thus, simply call the latter in the former. This allows us to automatically free the plot data in create_plot_info_new(). The old code overwrote the corresponding field with NULL. As a side-effect, this removes a bogus static variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
69be1e23f2
commit
ae60fdf815
4 changed files with 12 additions and 17 deletions
|
@ -636,8 +636,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
|
|||
* shown.
|
||||
*/
|
||||
|
||||
free_plot_info_data(&plotInfo);
|
||||
plotInfo = calculate_max_limits_new(&displayed_dive, currentdc);
|
||||
// create_plot_info_new() automatically frees old plot data
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
create_plot_info_new(&displayed_dive, currentdc, &plotInfo, !shouldCalculateMaxDepth, &DivePlannerPointsModel::instance()->final_deco_state);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue