Skip to content

core/generation: destroy the engine after the root's children - #1173

Merged
outfoxxed merged 1 commit into
quickshell-mirror:masterfrom
bbedward:defer-loading-clean
Sep 25, 2026
Merged

outfoxxed merged 1 commit into
quickshell-mirror:masterfrom
bbedward:defer-loading-clean

Conversation

@bbedward

@bbedward bbedward commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes intermittent crashes when quitting or reloading while an async Loader is still loading.

The root's destroyed signal fires before its children are deleted, so we were freeing the engine too early. Queue engine teardown so the children are destroyed first. JS interruption stays immediate.

This fixes the following core dump

#5  QScopedPointer<QObjectData>::get (this=<optimized out>)                 qscopedpointer.h:113
#9  doActivate<false> (sender=0x165, signal_index=7, ...)                   qobject.cpp:4271
#10 QMetaObject::activate<void, QList<QQmlError>> (sender=0x165, ...)
#11 QQmlEngine::warnings (this=0x165, _t1=...)                              moc_qqmlengine.cpp:243
#12 QQmlEnginePrivate::warning (this=0x7fd9b79a8300, error=...)             qqmlengine.cpp:1526
        q = 0x165                               
#13 QQmlIncubator::clear (this=0x7fd99566d560)                              qqmlincubator.cpp:653
        s = QQmlIncubator::Loading                
        enginePriv = 0x7fd9b79a8300
#14 QQuickLoaderPrivate::clear (this=0x7fd9b7918800)                        qquickloader.cpp:61
#15 QQuickLoader::~QQuickLoader (this=0x7fd9c7916cc0)                       qquickloader.cpp:275
#16 QQmlPrivate::QQmlElement<QQuickLoader>::~QQmlElement
#18 QObjectPrivate::deleteChildren (this=0x7fd9b79a3a00)                    qobject.cpp:2280
        i = 3                                       
#19 QObject::~QObject (this=0x7fd9b6914040)                                 qobject.cpp:1178
#20 Reloadable::~Reloadable (this=0x7fd9b6914040)                           reload.hpp:15
#22 ShellRoot::~ShellRoot                                                   shell.hpp:12
#23 QQmlPrivate::QQmlElement<ShellRoot>::~QQmlElement
#25 QObject::event (DeferredDelete)                                         qobject.cpp:1465
#29 QCoreApplicationPrivate::sendPostedEvents                               qcoreapplication.cpp:1926
#39 QCoreApplication::exec
#40 qs::launch::launch                                                      launch.cpp:325

@outfoxxed
outfoxxed merged commit 4594680 into quickshell-mirror:master Sep 25, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants