mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 23:35:20 +02:00
Merge pull request #7091 from jherico/overlayCrash
Prevent overlay cleanup from crashing the app
This commit is contained in:
commit
90d81bc17b
2 changed files with 8 additions and 1 deletions
|
@ -37,9 +37,16 @@
|
|||
|
||||
|
||||
Overlays::Overlays() : _nextOverlayID(1) {
|
||||
connect(qApp, &Application::beforeAboutToQuit, [=] {
|
||||
cleanupAllOverlays();
|
||||
});
|
||||
}
|
||||
|
||||
Overlays::~Overlays() {
|
||||
}
|
||||
|
||||
|
||||
void Overlays::cleanupAllOverlays() {
|
||||
{
|
||||
QWriteLocker lock(&_lock);
|
||||
QWriteLocker deleteLock(&_deleteLock);
|
||||
|
@ -53,7 +60,6 @@ Overlays::~Overlays() {
|
|||
_overlaysWorld.clear();
|
||||
_panels.clear();
|
||||
}
|
||||
|
||||
cleanupOverlaysToDelete();
|
||||
}
|
||||
|
||||
|
|
|
@ -145,6 +145,7 @@ signals:
|
|||
|
||||
private:
|
||||
void cleanupOverlaysToDelete();
|
||||
void cleanupAllOverlays();
|
||||
|
||||
QMap<unsigned int, Overlay::Pointer> _overlaysHUD;
|
||||
QMap<unsigned int, Overlay::Pointer> _overlaysWorld;
|
||||
|
|
Loading…
Reference in a new issue