core: fix shutdown sequence crashing
This commit is contained in:
parent
3991726b9b
commit
9e58077c61
|
@ -84,6 +84,14 @@ void EngineGeneration::destroy() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EngineGeneration::shutdown() {
|
||||||
|
delete this->root;
|
||||||
|
this->root = nullptr;
|
||||||
|
delete this->engine;
|
||||||
|
this->engine = nullptr;
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
|
|
||||||
void EngineGeneration::onReload(EngineGeneration* old) {
|
void EngineGeneration::onReload(EngineGeneration* old) {
|
||||||
if (old != nullptr) {
|
if (old != nullptr) {
|
||||||
// if the old generation holds the window incubation controller as the
|
// if the old generation holds the window incubation controller as the
|
||||||
|
|
|
@ -51,6 +51,7 @@ public:
|
||||||
QuickshellGlobal* qsgInstance = nullptr;
|
QuickshellGlobal* qsgInstance = nullptr;
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
|
void shutdown();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void filesChanged();
|
void filesChanged();
|
||||||
|
|
|
@ -35,11 +35,8 @@ RootWrapper::RootWrapper(QString rootPath)
|
||||||
RootWrapper::~RootWrapper() {
|
RootWrapper::~RootWrapper() {
|
||||||
// event loop may no longer be running so deleteLater is not an option
|
// event loop may no longer be running so deleteLater is not an option
|
||||||
if (this->generation != nullptr) {
|
if (this->generation != nullptr) {
|
||||||
delete this->generation->root;
|
this->generation->shutdown();
|
||||||
this->generation->root = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete this->generation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootWrapper::reloadGraph(bool hard) {
|
void RootWrapper::reloadGraph(bool hard) {
|
||||||
|
|
Loading…
Reference in a new issue