summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-10 07:18:03 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-10 07:18:03 (GMT)
commit606e15215b33b51a4bc716654388b8e9eaa647e6 (patch)
treeb786af92424c752ddc5fd130844281558ce17995 /tests/auto/qscriptvalue/tst_qscriptvalue.cpp
parent9bc46788f3b0f4a652be604d3facbcd84602677a (diff)
parent2c7bab684fa9684175b9a6c913a20a76f3502d08 (diff)
downloadQt-606e15215b33b51a4bc716654388b8e9eaa647e6.zip
Qt-606e15215b33b51a4bc716654388b8e9eaa647e6.tar.gz
Qt-606e15215b33b51a4bc716654388b8e9eaa647e6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Clear X11 structure before use Make operator QRectF const Fix GC-related crash in QScriptValue::setData() get rid of dependency on QtGui Removed implicity QtGui linking from icd.pro as it is not needed. DFB: Make sure QPixmap::hasAlpha is respected fix build on mingw Fix some painting issues in QDirectFBPaintEngine QNAM: Do not need QNetworkSession in AlwaysCache load mode Don't crash if QScriptClass property getter returns an invalid value QNAM: Remove dead waitForUpstreamBytesWritten() code QNAM: Remove dead waitForDownstreamReadyRead() code fix memleak in test
Diffstat (limited to 'tests/auto/qscriptvalue/tst_qscriptvalue.cpp')
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 639df36..53e2699 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2253,6 +2253,19 @@ void tst_QScriptValue::getSetData()
QVERIFY(!object.data().isValid());
}
+void tst_QScriptValue::setData_QTBUG15144()
+{
+ QScriptEngine eng;
+ QScriptValue obj = eng.newObject();
+ for (int i = 0; i < 10000; ++i) {
+ // Create an object with property 'fooN' on it, and immediately kill
+ // the reference to the object so it and the property name become garbage.
+ eng.evaluate(QString::fromLatin1("o = {}; o.foo%0 = 10; o = null;").arg(i));
+ // Setting the data will cause a JS string to be allocated, which could
+ // trigger a GC. This should not cause a crash.
+ obj.setData("foodfight");
+ }
+}
class TestScriptClass : public QScriptClass
{
public: