diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-03 18:37:56 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-02-06 08:51:32 -0800 |
commit | 285ea9b7ca71e11c2f821cf1b314083cd55e95d0 (patch) | |
tree | d1cd2a39dbc4c4ab1b5e8457c3576387876976de /Documentation | |
parent | cf1e3524a1e000c27ff97e69b21d87d92cbbcc1a (diff) | |
download | subsurface-285ea9b7ca71e11c2f821cf1b314083cd55e95d0.tar.gz |
Cleanup: don't initialize DivePlannerPointsModel at startup
The whole point of having X::instance() functions is to solve
the infamous "Static Initialization Order Fiasco": When having
global objects in different translation units, their order
of initialization is undefined. Thus, when these objects access
each other one cannot guarantee the correct order of
initialization. The X::instance() functions generate the objects
on first use.
DivePlannerPointsModel has such an instance() function. However,
for convenience(?) in diveplanner.cpp we find the global variable
static DivePlannerPointsModel* plannerModel =
DivePlannerPointsModel::instance();
Thus, the DivePlannerPointsModel constructor is run before main(),
negating the whole purpose of the instance() function.
Let's remove this line to avoid hard-to-debug startup issues.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions