diff options
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r-- | core/qthelper.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 8082db742..700854ebc 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -388,13 +388,14 @@ QVector<QPair<QString, int>> selectedDivesGasUsed() for_each_dive (i, d) { if (!d->selected) continue; - volume_t diveGases[MAX_CYLINDERS] = {}; - get_gas_used(d, diveGases); - for (j = 0; j < MAX_CYLINDERS; j++) + volume_t *diveGases = get_gas_used(d); + for (j = 0; j < MAX_CYLINDERS; j++) { if (diveGases[j].mliter) { QString gasName = gasname(d->cylinder[j].gasmix); gasUsed[gasName] += diveGases[j].mliter; } + } + free(diveGases); } QVector<QPair<QString, int>> gasUsedOrdered; gasUsedOrdered.reserve(gasUsed.size()); |