-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 2.2.0
-
None
-
f3e22da48cb4ae1c8be48072c852a1a24e54f953
Adding the following test code results in a deadlock of the code.
void tst_Aggregate::parentAggregate()
{
Aggregation::Aggregate aggregation;
+ Aggregation::Aggregate aggregation2;
Interface1 *component1 = new Interface1;
Interface11 *component11 = new Interface11;
QObject *component2 = new QObject;
aggregation.add(component1);
aggregation.add(component11);
QCOMPARE(Aggregation::Aggregate::parentAggregate(&aggregation), &aggregation);
QCOMPARE(Aggregation::Aggregate::parentAggregate(component1), &aggregation);
QCOMPARE(Aggregation::Aggregate::parentAggregate(component11), &aggregation);
QCOMPARE(Aggregation::Aggregate::parentAggregate(component2), (Aggregation::Aggregate *)0);
+ // test reparenting a component to another aggregate.
+ aggregation2.add(component11);
+ QCOMPARE(Aggregation::Aggregate::parentAggregate(component11), &aggregation2);
+ // test adding an aggregate to an aggregate
+ aggregation.add(&aggregation2);
+ QCOMPARE(Aggregation::Aggregate::parentAggregate(&aggregation2), &aggregation);
+ // test reparenting an aggregate to an aggregate
+ aggregation2.add(&aggregation);
+ QCOMPARE(Aggregation::Aggregate::parentAggregate(&aggregation2), &aggregation);
+ // test removing an object from an aggregation.
+ aggregation2.remove(component11);
+ QCOMPARE(Aggregation::Aggregate::parentAggregate(component11), (Aggregation::Aggregate *)0);
}
| For Gerrit Dashboard: QTCREATORBUG-4926 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 679,1 | Remove some aggregation deadlocks. | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |