core: use std::unique_ptr<> to make ownership transfer more clear

The decostate was generated in the main thread and passed down to
a worker thread. To make that explicit, use an std::unique_ptr<>
and std::move().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-13 23:32:49 +02:00 committed by bstoeger
parent d594cc72f0
commit 541abf7ae4
2 changed files with 8 additions and 10 deletions

View file

@ -4,6 +4,7 @@
#include <QAbstractTableModel>
#include <QDateTime>
#include <memory>
#include <vector>
#include "core/deco.h"
@ -132,7 +133,7 @@ private:
struct divedatapoint *cloneDiveplan(struct diveplan *plan_src, struct diveplan *plan_copy);
void computeVariationsDone(QString text);
void computeVariations(struct diveplan *diveplan, const struct deco_state *ds);
void computeVariationsFreeDeco(struct diveplan *diveplan, struct deco_state *ds);
void computeVariationsFreeDeco(struct diveplan *diveplan, std::unique_ptr<struct deco_state> ds);
int analyzeVariations(struct decostop *min, struct decostop *mid, struct decostop *max, const char *unit);
struct dive *d;
int dcNr;