Skip to content
Permalink
Browse files
2010-04-14 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
        Reviewed by Kenneth Rohde Christiansen.

        Fix memory leak inside QScriptEnginePrivate::makeJSValue.

        QScriptEnginePrivate::makeJSValue should release temporary JSStringRef variable.

        [Qt] tst_QScriptValue::toString has a memory leak.
        https://bugs.webkit.org/show_bug.cgi?id=37598

        * qt/api/qscriptengine_p.h:
        (QScriptEnginePrivate::makeJSValue):

Canonical link: https://commits.webkit.org/48912@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Apr 15, 2010
1 parent 0364361 commit a14cfcd1922c38c441d074ac29e0f35f7e54653f
Showing 2 changed files with 18 additions and 1 deletion.
@@ -1,3 +1,17 @@
2010-04-14 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

Fix memory leak inside QScriptEnginePrivate::makeJSValue.

QScriptEnginePrivate::makeJSValue should release temporary JSStringRef variable.

[Qt] tst_QScriptValue::toString has a memory leak.
https://bugs.webkit.org/show_bug.cgi?id=37598

* qt/api/qscriptengine_p.h:
(QScriptEnginePrivate::makeJSValue):

2010-04-14 Peter Varga <pvarga@inf.u-szeged.hu>

Reviewed by Geoffrey Garen.
@@ -104,7 +104,10 @@ JSValueRef QScriptEnginePrivate::makeJSValue(uint number) const

JSValueRef QScriptEnginePrivate::makeJSValue(const QString& string) const
{
return JSValueMakeString(m_context, QScriptConverter::toString(string));
JSStringRef tmp = QScriptConverter::toString(string);
JSValueRef result = JSValueMakeString(m_context, tmp);
JSStringRelease(tmp);
return result;
}

JSValueRef QScriptEnginePrivate::makeJSValue(bool value) const

0 comments on commit a14cfcd

Please sign in to comment.