From 2d3b3e9c70ef380dff751b61d334dc88df016c29 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 29 Aug 2026 02:11:43 -0700 Subject: [PATCH] core/generation: destroy generation extensions after js interruption --- src/core/generation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/generation.cpp b/src/core/generation.cpp index 21febc3..b972f52 100644 --- a/src/core/generation.cpp +++ b/src/core/generation.cpp @@ -62,6 +62,10 @@ EngineGeneration::EngineGeneration(const QDir& rootPath, QmlScanner scanner) EngineGeneration::EngineGeneration(): EngineGeneration(QDir(), QmlScanner()) {} EngineGeneration::~EngineGeneration() { + for (auto* extension: this->extensions.values()) { + delete extension; + } + if (this->engine != nullptr) { qFatal() << this << "destroyed without calling destroy()"; } @@ -78,10 +82,6 @@ void EngineGeneration::destroy() { this->watcher = nullptr; } - for (auto* extension: this->extensions.values()) { - delete extension; - } - if (this->root != nullptr) { QObject::connect(this->root, &QObject::destroyed, this, [this]() { // prevent further js execution between garbage collection and engine destruction.