Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix v8 handle management in QSGLoader
Previously, setting the source to a remote url and specified some initial property values while active was false, and then setting active to true, would cause undefined behaviour. This commit ensures that the handles are managed correctly, and that an appropriate v8 context exists during object creation with initial property values specified. Task-number: QTBUG-21868 Change-Id: I101c6546537aa05aaeb420195aca670bc71f31e1 Reviewed-on: http://codereview.qt-project.org/6109 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
- Loading branch information
Chris Adams
authored and
Qt by Nokia
committed
Oct 6, 2011
1 parent
71611d0
commit e29f198
Showing
4 changed files
with
38 additions
and
1 deletion.
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
20 changes: 20 additions & 0 deletions
20
tests/auto/declarative/qsgloader/data/initialPropertyValues.8.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,20 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
id: root | ||
property int initialValue: 0 | ||
|
||
Loader { | ||
id: loader | ||
objectName: "loader" | ||
active: false | ||
onLoaded: { | ||
root.initialValue = loader.item.canary; // should be six | ||
} | ||
} | ||
|
||
Component.onCompleted: { | ||
loader.setSource("http://127.0.0.1:14450/InitialPropertyValuesComponent.qml", {"canary": 6}); | ||
loader.active = true; | ||
} | ||
} |
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