Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent the root object from being garbage collected.
Passing the root object as a return value from a C++ function could cause the indestructible flag to be set to false. Change-Id: Ib70c666f0d0ffbb48bca1996c2517fbccafa5dc1 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
- Loading branch information
Michael Brasser
authored and
Qt by Nokia
committed
Mar 23, 2012
1 parent
b63ce68
commit 91f9f12
Showing
6 changed files
with
108 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/auto/qml/qqmlecmascript/data/ownershipConsistency.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
Loader { | ||
source: "PropertyVarBaseItem.qml" | ||
onLoaded: item.destroy() | ||
} | ||
Loader { | ||
Component.onCompleted: setSource("PropertyVarBaseItem.qml", { random: "" }) | ||
onLoaded: item.destroy() | ||
} | ||
|
||
Repeater { | ||
model: 1 | ||
Item { Component.onCompleted: destroy() } | ||
} | ||
Repeater { | ||
model: 1 | ||
Item { id: me; Component.onCompleted: { setObject(me); getObject().destroy() } } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import QtQuick 2.0 | ||
|
||
QtObject { | ||
id: root | ||
Component.onCompleted: { setObject(root); getObject() } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters