mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
a8aa897117
TabDiveInformation::updateProfile() does some statistics via the per_cylinder_mean_depth function. It passes down arrays with one entry per cylinder, which are allocated by means std::vector. To pass the array, the expression "&vector[0]" is used. It seems like some compilers through an assertion violation if vector has no elements. They are technically correct in that this is undefined, but still this appears like very unfriendly behavior. After all, std::vector should behave just like a dynamic C-array that is automatically freed, when going out of scope. Replace the "&vector[0]" by "vector.data()" and don't do the call if there aren't any cylinders for good measure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> |
||
---|---|---|
.. | ||
maintab.cpp | ||
maintab.h | ||
maintab.ui | ||
TabBase.cpp | ||
TabBase.h | ||
TabDiveEquipment.cpp | ||
TabDiveEquipment.h | ||
TabDiveEquipment.ui | ||
TabDiveExtraInfo.cpp | ||
TabDiveExtraInfo.h | ||
TabDiveExtraInfo.ui | ||
TabDiveInformation.cpp | ||
TabDiveInformation.h | ||
TabDiveInformation.ui | ||
TabDivePhotos.cpp | ||
TabDivePhotos.h | ||
TabDivePhotos.ui | ||
TabDiveSite.cpp | ||
TabDiveSite.h | ||
TabDiveSite.ui | ||
TabDiveStatistics.cpp | ||
TabDiveStatistics.h | ||
TabDiveStatistics.ui |