diff options
author | juhvu <qt-info@nokia.com> | 2010-11-10 03:54:39 (GMT) |
---|---|---|
committer | juhvu <qt-info@nokia.com> | 2010-11-10 03:54:39 (GMT) |
commit | 2c7bab684fa9684175b9a6c913a20a76f3502d08 (patch) | |
tree | a69572bf525aae044a96820129f24bc63124fd07 /tests/auto/qscriptvalue/tst_qscriptvalue.cpp | |
parent | a55c13c52822f337cc4ad708881fd54d3a1bbb1d (diff) | |
parent | 2ec60d5a71a560460c884be36de8fbad467fb69d (diff) | |
download | Qt-2c7bab684fa9684175b9a6c913a20a76f3502d08.zip Qt-2c7bab684fa9684175b9a6c913a20a76f3502d08.tar.gz Qt-2c7bab684fa9684175b9a6c913a20a76f3502d08.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tests/auto/qscriptvalue/tst_qscriptvalue.cpp')
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 13 |
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: |