Details
Description
The following example leaks the memory of the argument passed to the script function call.
It seems like the argument is never marked for garbage collection.
Am I using the API in the right way?
Thanks.
#include <QCoreApplication>
#include <QScriptValue>
#include <QScriptEngine>
#include <QDebug>
class Test : QObject
{
Q_OBJECT
public:
Test()
{
functionCode = "function f(a)
";
engine.evaluate(functionCode);
v = engine.globalObject().property("f");
startTimer(0);
};
void timerEvent(QTimerEvent* t)
QScriptValue v;
QString functionCode;
QScriptEngine engine;
};
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
Test t;
return app.exec();
}