Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ensure JS-owned QObjects are cleaned up on v8engine dtor
This commit ensures that the garbage collector is invoked during engine destruction. This commit also adds a unit test which ensures that the JS GC destroys JS-owned C++ objects correctly when the QDeclarativeEngine is destroyed. Task-number: QTBUG-20377 Change-Id: I2de1f2dfd1e60cc2f76abb523b99bf169d2a5a13 Reviewed-on: http://codereview.qt-project.org/3285 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
Sep 30, 2011
1 parent
bc2f2c5
commit 5d62a90
Showing
5 changed files
with
101 additions
and
0 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
20 changes: 20 additions & 0 deletions
20
tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreationOwnership.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 | ||
import Qt.test 1.0 | ||
|
||
Item { | ||
id: obj | ||
objectName: "obj" | ||
|
||
MyDynamicCreationDestructionObject { | ||
id: mdcdo | ||
objectName: "mdcdo" | ||
} | ||
|
||
function dynamicallyCreateJsOwnedObject() { | ||
mdcdo.createNew(); | ||
} | ||
|
||
function performGc() { | ||
gc(); | ||
} | ||
} |
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