-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8, 6.9, 6.10
-
None
-
2d016a265 (dev), 2356043fc (6.10), e1bd1baee (6.9)
Consider:
#ifndef COLLECTOR_H #define COLLECTOR_H #include <QtCore/qobject.h> #include <QtQmlIntegration/qqmlintegration.h> #include <QtQml/qjsengine.h> class Collector : public QObject { Q_OBJECT QML_ELEMENT public: Q_INVOKABLE void gc() { qjsEngine(this)->collectGarbage(); } }; #endif // COLLECTOR_H
pragma Strict import QtQml Collector { id: self property Component c: QtObject { objectName: "dynamic" } property QtObject o: c.createObject() Component.onCompleted: { var oo = o o = null self.gc() o = oo } }
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; QObject::connect( &engine, &QQmlApplicationEngine::objectCreated, &app, [](QObject *o) { qDebug() << o->property("o"); QCoreApplication::exit(0); }, Qt::QueuedConnection); engine.loadFromModule("deletedobjects", "Main"); return app.exec(); }
This will output QVariant(QObject*, 0x0) when run with disk cache and QVariant(QObject*, 0x611000007700) when run with QML_DISABLE_DISK_CACHE=1
- relates to
-
QTBUG-139025 [Reg 6.5.9 -> 6.8.4] Lists of objects with JavaScriptOwnership, stored in var properties, are no longer destroyed
-
- In Progress
-
-
QTBUG-138944 List of objects with JavaScriptOwnership are not ref-counted correctly when assigned to ListView.model
-
- In Progress
-
-
QTBUG-138919 [Reg 6.5.9 -> 6.8.4] Unreferenced objects with JavaScriptOwnership are no longer destroyed
-
- Closed
-
-
QTBUG-139053 Re-design transfer of QObject ownership to JavaScript
-
- Open
-
For Gerrit Dashboard: QTBUG-139059 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
673207,2 | QtQml: Mark values on the AOT-compiled stack during gc | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: NEW | +2 | 0 |
667499,17 | QtQml: Mark values on the AOT-compiled stack during gc | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
672767,2 | QtQml: Mark values on the AOT-compiled stack during gc | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
673155,2 | QtQml: Mark values on the AOT-compiled stack during gc | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |