diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-13 10:28:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-13 10:28:56 (GMT) |
commit | 413ad2471afea9f82134942c2c1e5cfe22479139 (patch) | |
tree | 2dd641098e6ab1dc9624e35328e99957e91ab00f /tests/auto/qsharedpointer/tst_qsharedpointer.cpp | |
parent | 76da3ecd74ad55fe923eb59f10c1f371611642f4 (diff) | |
parent | a736d333aab9e2e97fdbb738b3f3f4646afe192e (diff) | |
download | Qt-413ad2471afea9f82134942c2c1e5cfe22479139.zip Qt-413ad2471afea9f82134942c2c1e5cfe22479139.tar.gz Qt-413ad2471afea9f82134942c2c1e5cfe22479139.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Compile when bootstrapping qmake
Fix regression in tst_qrand::testqrand()
syncqt: don't try to split %module's values
syncqt: fix wrong paths in include/ActiveQt/headers.pri
Fix a crash when recursing into QSharedPointer from QSharedPointer::clear()
Fix a couple of memory leaks due to not releasing CFTypes on Mac
Initalize the nativeDialogInUse variable
Compile
QUUid::createUuid() should not generate identical sequences on UNIX
Diffstat (limited to 'tests/auto/qsharedpointer/tst_qsharedpointer.cpp')
-rw-r--r-- | tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index cb32c9a..4bbc9d8 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -92,6 +92,8 @@ private slots: void creating(); void creatingQObject(); void mixTrackingPointerCode(); + void reentrancyWhileDestructing(); + void threadStressTest_data(); void threadStressTest(); void validConstructs(); @@ -1770,6 +1772,60 @@ void tst_QSharedPointer::invalidConstructs() } } +namespace QTBUG11730 { + struct IB + { + virtual ~IB() {} + }; + + struct IA + { + virtual QSharedPointer<IB> getB() = 0; + }; + + struct B: public IB + { + IA *m_a; + B(IA *a_a) :m_a(a_a) + { } + ~B() + { + QSharedPointer<IB> b = m_a->getB(); + } + }; + + struct A: public IA + { + QSharedPointer<IB> b; + + virtual QSharedPointer<IB> getB() + { + return b; + } + + A() + { + b = QSharedPointer<IB>(new B(this)); + } + + ~A() + { + b.clear(); + } + }; +} + +void tst_QSharedPointer::reentrancyWhileDestructing() +{ + // this bug is about recursing back into QSharedPointer::clear() + // from inside it + // that is, the destructor of the object being deleted recurses + // into the same QSharedPointer object. + // First reported as QTBUG-11730 + QTBUG11730::A obj; +} + + QTEST_MAIN(tst_QSharedPointer) #include "tst_qsharedpointer.moc" |