core: make clone_* functions return a unique_ptr<>

Don't use plain pointers for owning pointers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-04 07:10:22 +02:00 committed by bstoeger
parent 0ef497c3c9
commit 1e09ec77d7
4 changed files with 22 additions and 31 deletions

View file

@ -237,7 +237,7 @@ class DiveComputerBase : public DiveListBase {
protected:
// old_dive must be a dive known to the core.
// new_dive must be new dive whose ownership is taken.
DiveComputerBase(dive *old_dive, dive *new_dive, int dc_nr_before, int dc_nr_after);
DiveComputerBase(dive *old_dive, std::unique_ptr<dive> new_dive, int dc_nr_before, int dc_nr_after);
private:
void undoit() override;
void redoit() override;