mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
Delay Overlays cleanup for scripting
This commit is contained in:
parent
a0d80b9508
commit
694dc1bbf6
3 changed files with 7 additions and 11 deletions
|
@ -1189,6 +1189,9 @@ void Application::cleanupBeforeQuit() {
|
|||
DependencyManager::get<ScriptEngines>()->shutdownScripting(); // stop all currently running global scripts
|
||||
DependencyManager::destroy<ScriptEngines>();
|
||||
|
||||
// Cleanup all overlays after the scripts, as scripts might add more
|
||||
_overlays.cleanupAllOverlays();
|
||||
|
||||
// first stop all timers directly or by invokeMethod
|
||||
// depending on what thread they run in
|
||||
locationUpdateTimer.stop();
|
||||
|
|
|
@ -36,15 +36,8 @@
|
|||
#include <QtQuick/QQuickWindow>
|
||||
|
||||
|
||||
Overlays::Overlays() : _nextOverlayID(1) {
|
||||
connect(qApp, &Application::beforeAboutToQuit, [=] {
|
||||
cleanupAllOverlays();
|
||||
});
|
||||
}
|
||||
|
||||
Overlays::~Overlays() {
|
||||
}
|
||||
|
||||
Overlays::Overlays() :
|
||||
_nextOverlayID(1) {}
|
||||
|
||||
void Overlays::cleanupAllOverlays() {
|
||||
{
|
||||
|
|
|
@ -62,7 +62,6 @@ class Overlays : public QObject {
|
|||
|
||||
public:
|
||||
Overlays();
|
||||
~Overlays();
|
||||
|
||||
void init();
|
||||
void update(float deltatime);
|
||||
|
@ -73,6 +72,8 @@ public:
|
|||
Overlay::Pointer getOverlay(unsigned int id) const;
|
||||
OverlayPanel::Pointer getPanel(unsigned int id) const { return _panels[id]; }
|
||||
|
||||
void cleanupAllOverlays();
|
||||
|
||||
public slots:
|
||||
/// adds an overlay with the specific properties
|
||||
unsigned int addOverlay(const QString& type, const QVariant& properties);
|
||||
|
@ -145,7 +146,6 @@ signals:
|
|||
|
||||
private:
|
||||
void cleanupOverlaysToDelete();
|
||||
void cleanupAllOverlays();
|
||||
|
||||
QMap<unsigned int, Overlay::Pointer> _overlaysHUD;
|
||||
QMap<unsigned int, Overlay::Pointer> _overlaysWorld;
|
||||
|
|
Loading…
Reference in a new issue