Remove the default parent applied to component instances created by
Qt.createComponent(). This allows these objects to be managed by usual
JS reference management, and thus to be appropriately garbage
collected.
Task-number: QTBUG-24841
Change-Id: I29efbb9d8f5a2ef4c74415399fa3024e6590004b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
return v8::Null();
QQmlComponent::CompilationMode compileMode = QQmlComponent::PreferSynchronous;
-
- // Default to engine parent; this will be removed in the near future (QTBUG-24841)
- QObject *parentArg = engine;
+ QObject *parentArg = 0;
int consumedCount = 1;
if (args.Length() > 1) {
QVERIFY(created);
QObject *expectedParent;
- if (createdParent.isEmpty()) {
- // For now, the parent should be the engine; this will change for QTBUG-24841
- expectedParent = &engine;
- } else if (createdParent == QLatin1String("obj")) {
+ if (createdParent == QLatin1String("obj")) {
expectedParent = object;
- } else if (createdParent == QLatin1String("null")) {
+ } else if ((createdParent == QLatin1String("null")) || createdParent.isEmpty()) {
expectedParent = 0;
}
QCOMPARE(created->parent(), expectedParent);