diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-12-18 12:01:36 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-06 10:00:39 -0800 |
commit | 64dae43bddf2894f0891b56e5f419e325309a66f (patch) | |
tree | 07fd968cfdf199483ea69db0d87610b4e1ab4615 /stats/statsvariables.h | |
parent | 8a36a100ce073decb5cb236efbd7c4ce93f5abc2 (diff) | |
download | subsurface-64dae43bddf2894f0891b56e5f419e325309a66f.tar.gz |
desktop: do own memory management of quadrant widgets
The memory management of the quadrant widgets is a total mess:
When setting the widget, the QSplitters take ownership, which
means that they will delete the widget in their destructor.
This is inherently incompatible with singletons, which must
not be deleted.
To avoid all these troubles, remove the widgets from the
QSplitters in the desctructor of the MainWindow. This of
course means that we now have to take care about deletion
of the widgets.
For local widgets use std::unique_ptr, for singletons use
a static variable that is deleted on application exit.
Sadly, for the map widget we can't use a normal singleton,
because the QML MapWidget's memory management is buggy.
Add a comment in the source code explaining this.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsvariables.h')
0 files changed, 0 insertions, 0 deletions