From bccf43f1f70bb22e8deacb7acbe9b8286a3cb1f9 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 3 Mar 2024 06:26:41 -0800 Subject: [PATCH] fix: root is now destroyed on exit This should fix a whole lot of things never being able to run cleanup. --- src/core/rootwrapper.cpp | 5 +++++ src/core/rootwrapper.hpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/core/rootwrapper.cpp b/src/core/rootwrapper.cpp index c88825d..34ef81f 100644 --- a/src/core/rootwrapper.cpp +++ b/src/core/rootwrapper.cpp @@ -26,6 +26,11 @@ RootWrapper::RootWrapper(QString rootPath) } } +RootWrapper::~RootWrapper() { + // event loop may no longer be running so deleteLater is not an option + delete this->root; +} + void RootWrapper::reloadGraph(bool hard) { if (this->root != nullptr) { this->engine.clearComponentCache(); diff --git a/src/core/rootwrapper.hpp b/src/core/rootwrapper.hpp index 534a766..7e78a18 100644 --- a/src/core/rootwrapper.hpp +++ b/src/core/rootwrapper.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -13,6 +14,8 @@ class RootWrapper: public QObject { public: explicit RootWrapper(QString rootPath); + ~RootWrapper() override; + Q_DISABLE_COPY_MOVE(RootWrapper); void reloadGraph(bool hard);