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

        Fix a memory leak in QScriptValue::inherits.

        [Qt] QScriptValue::inherits has a memory leak.
        https://bugs.webkit.org/show_bug.cgi?id=37617

        * qt/api/qscriptvalue_p.h:
        (QScriptValuePrivate::inherits):

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

Reviewed by Kenneth Rohde Christiansen.

Fix a memory leak in QScriptValue::inherits.

[Qt] QScriptValue::inherits has a memory leak.
https://bugs.webkit.org/show_bug.cgi?id=37617

* qt/api/qscriptvalue_p.h:
(QScriptValuePrivate::inherits):

2010-04-14 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>

Reviewed by Kenneth Rohde Christiansen.
@@ -711,7 +711,9 @@ bool QScriptValuePrivate::inherits(const char* name)
{
Q_ASSERT(isJSBased());
JSObjectRef globalObject = JSContextGetGlobalObject(context());
JSValueRef error = JSObjectGetProperty(context(), globalObject, QScriptConverter::toString(name), 0);
JSStringRef errorAttrName = QScriptConverter::toString(name);
JSValueRef error = JSObjectGetProperty(context(), globalObject, errorAttrName, /* exception */ 0);
JSStringRelease(errorAttrName);
return JSValueIsInstanceOfConstructor(context(), value(), JSValueToObject(context(), error, /* exception */ 0), /* exception */ 0);
}

0 comments on commit 94ff666

Please sign in to comment.