subsurface/desktop-widgets/tab-widgets
Berthold Stoeger a8aa897117 desktop: don't access first data element if no cylinders
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>
2020-04-21 07:50:38 -07:00
..
maintab.cpp desktop/tabwidgets: replace editMode by boolean 2020-04-07 00:13:35 +02:00
maintab.h desktop/tabwidgets: replace editMode by boolean 2020-04-07 00:13:35 +02:00
maintab.ui Fixes in tab widget UI layout 2019-11-16 08:32:07 -08:00
TabBase.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
TabBase.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
TabDiveEquipment.cpp cleanup: remove unneeded includes from TabDiveEquipment.cpp 2020-04-07 00:13:35 +02:00
TabDiveEquipment.h undo: show multiple dive warning when editing equipment 2020-04-07 00:13:35 +02:00
TabDiveEquipment.ui Move the Suit text box from the Notes tab to the Equipment tab 2019-08-08 09:12:09 -07:00
TabDiveExtraInfo.cpp Desktop: don't connect to remove() slot of model from TableModel 2019-12-05 10:14:25 -08:00
TabDiveExtraInfo.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
TabDiveExtraInfo.ui Cleanup: Move dive-equipment tab into own translation units 2019-04-15 10:30:04 +12:00
TabDiveInformation.cpp desktop: don't access first data element if no cylinders 2020-04-21 07:50:38 -07:00
TabDiveInformation.h Cleanup: lower-case filenames in core/subsurface-qt/ 2020-02-04 02:16:46 +01:00
TabDiveInformation.ui desktop UI: small cleanups of salinity code 2020-01-06 07:00:34 +09:00
TabDivePhotos.cpp Grammar: replaces 'indexes' by 'indices' 2020-03-11 08:26:30 -07:00
TabDivePhotos.h Write dive data as video subtitles 2019-04-16 20:38:19 +02:00
TabDivePhotos.ui Implement different zoom levels for dive photos tab 2017-12-18 12:07:10 -08:00
TabDiveSite.cpp Grammar: replaces 'indexes' by 'indices' 2020-03-11 08:26:30 -07:00
TabDiveSite.h Desktop: don't connect to remove() slot of model from TableModel 2019-12-05 10:14:25 -08:00
TabDiveSite.ui desktop: rearrange widgets on the dive site tab 2020-04-20 09:46:24 -07:00
TabDiveStatistics.cpp Cleanup: use quotation marks for non-system includes 2019-12-04 13:00:23 +01:00
TabDiveStatistics.h Cleanup: lower-case filenames in core/subsurface-qt/ 2020-02-04 02:16:46 +01:00
TabDiveStatistics.ui Show average max depth in statistics tab 2018-12-17 12:18:26 +01:00