mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
import: fix memory leak when importing dives
A long standing issue: the dives_to_add, etc. tables need to be manually freed. This kind of problem wouldn't arise with proper C++ data structures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1aa5438b2d
commit
2776a2fe48
2 changed files with 9 additions and 0 deletions
|
@ -521,6 +521,11 @@ ImportDives::ImportDives(struct divelog *log, int flags, const QString &source)
|
|||
continue;
|
||||
filterPresetsToAdd.emplace_back(preset.name, preset.data);
|
||||
}
|
||||
|
||||
free(dives_to_add.dives);
|
||||
free(dives_to_remove.dives);
|
||||
free(trips_to_add.trips);
|
||||
free(sites_to_add.dive_sites);
|
||||
}
|
||||
|
||||
bool ImportDives::workToBeDone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue