Changeset 58755 in webkit


Ignore:
Timestamp:
May 4, 2010 6:53:57 AM (14 years ago)
Author:
eric@webkit.org
Message:

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

Reviewed by Holger Freyther.

Fix a memory leak inside the QScriptValue.

QSciptValuePrivate::toString should release all temporary variables.

[Qt] QScriptValue::toString have a memory leak.
https://bugs.webkit.org/show_bug.cgi?id=38112

  • qt/api/qscriptvalue_p.h: (QScriptValuePrivate::toString):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r58753 r58755  
     12010-05-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
     2
     3        Reviewed by Holger Freyther.
     4
     5        Fix a memory leak inside the QScriptValue.
     6
     7        QSciptValuePrivate::toString should release all temporary variables.
     8
     9        [Qt] QScriptValue::toString have a memory leak.
     10        https://bugs.webkit.org/show_bug.cgi?id=38112
     11
     12        * qt/api/qscriptvalue_p.h:
     13        (QScriptValuePrivate::toString):
     14
    1152010-05-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    216
  • trunk/JavaScriptCore/qt/api/qscriptvalue_p.h

    r58483 r58755  
    2525#include "qscriptvalue.h"
    2626#include <JavaScriptCore/JavaScript.h>
     27#include <JavaScriptCore/JSRetainPtr.h>
    2728#include <QtCore/qmath.h>
    2829#include <QtCore/qnumeric.h>
     
    425426    case JSPrimitive:
    426427    case JSObject:
    427         return QScriptConverter::toString(JSValueToStringCopy(context(), value(), /* exception */ 0));
     428        JSRetainPtr<JSStringRef> ptr(Adopt, JSValueToStringCopy(context(), value(), /* exception */ 0));
     429        return QScriptConverter::toString(ptr.get());
    428430    }
    429431
Note: See TracChangeset for help on using the changeset viewer.