diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-29 16:25:23 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-10-30 10:54:51 +0000 |
commit | eb11f6f6c92b04698a2801f52ae1ff57ca365f5b (patch) | |
tree | 0ef5e59bbb49a7c37ece450f447b10372eef72fe | |
parent | 6315acaa5a5c0a77f66c1b88db1fd1e445f41acc (diff) |
Revert "qquickloader: Free memory of loaded components after source change"
This reverts commit c5085eb8905f1a3c070f866746110980e84be271.
It can cause crashes and only fixes an edge case that can't
be encountered during normal usage.
Change-Id: Ia265f0d6716b59a0f483e5a114b3f3b1a76fe898
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 0fa6091b1076bc3cc58303ff00d43efdad32b8ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/items/qquickloader.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 970e808854..d0e29c204e 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -411,19 +411,6 @@ void QQuickLoader::setSource(const QUrl &url) void QQuickLoader::setSource(const QUrl &url, bool needsClear) { Q_D(QQuickLoader); - - // The source has been changed at this point, and we assume that (after - // notifying potential listeners with sourceChanged) that it is now - // safe to actually delete the old component. We have to do this here - // in case the component referenced expensive resources (like uncached - // images), as it might take too long until we return to the event loop. - // We need to explicitly pass QEvent::DeferredDelete to sendPostedEvents, - // else the allowDeferredDelete check in qcoreapplication.cpp will not - // allow the event to pass. This will not affect anything deleted by this - // call, only the previous one. This has to be done as otherwise there - // might be signal handlers that are still in progress. - QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); - if (d->source == url) return; |