Changeset 58755 in webkit for trunk/JavaScriptCore/qt


Ignore:
Timestamp:
May 4, 2010, 6:53:57 AM (15 years ago)
Author:
[email protected]
Message:

2010-05-04 Jedrzej Nowacki <[email protected]>

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):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.