~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.2.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
import Qt.test 1.0
 
3
 
 
4
Item {
 
5
    id: obj
 
6
    objectName: "obj"
 
7
 
 
8
    property CircularReferenceObject first
 
9
    property CircularReferenceObject second
 
10
 
 
11
 
 
12
    CircularReferenceObject {
 
13
        id: cro
 
14
        objectName: "cro"
 
15
    }
 
16
 
 
17
    function circularReference() {
 
18
        // generate the circularly referential pair - they should still be collected
 
19
        first = cro.generate();  // no parent, so should be collected
 
20
        second = cro.generate(); // no parent, so should be collected
 
21
        first.addReference(second);
 
22
        second.addReference(first);
 
23
 
 
24
        // remove top level references
 
25
        first = cro;
 
26
        second = cro;
 
27
    }
 
28
}