aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language/tst_language.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/corelib/language/tst_language.cpp')
-rw-r--r--src/lib/corelib/language/tst_language.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/corelib/language/tst_language.cpp b/src/lib/corelib/language/tst_language.cpp
index 71436c3a3..ff19b8afe 100644
--- a/src/lib/corelib/language/tst_language.cpp
+++ b/src/lib/corelib/language/tst_language.cpp
@@ -724,17 +724,25 @@ void TestLanguage::invalidBindingInDisabledItem()
class JSSourceValueCreator
{
FileContextPtr m_fileContext;
+ QList<QString *> m_strings;
public:
JSSourceValueCreator(const FileContextPtr &fileContext)
: m_fileContext(fileContext)
{
}
+ ~JSSourceValueCreator()
+ {
+ qDeleteAll(m_strings);
+ }
+
JSSourceValuePtr create(const QString &sourceCode)
{
JSSourceValuePtr value = JSSourceValue::create();
value->setFile(m_fileContext);
- value->setSourceCode(sourceCode);
+ QString *str = new QString(sourceCode);
+ m_strings += str;
+ value->setSourceCode(QStringRef(str));
return value;
}
};