Details
Description
function getWindow() { window = qwidget(1280,1024); object.transactionCompleted.connect(window, "deleteLater"); return window; }
The first time object.transactionCompleted is emitted, I don't get an error.
The second time object.transactionCompleted is emitted, I get an uncaught exception:
Error: cannot call function of deleted QObject <anonymous>(QVariant(Enzo::Pay::TransactionResult))@:-1 <global>()@:-
The qwidget function is implemented like this:
QScriptValue qwidgetMaker(QScriptContext *context, QScriptEngine *engine) { QWidget *w = new QWidget(NULL); w->resize( context->argument(0).toInt32(), context->argument(1).toInt32() ); QScriptValue v = engine->newQObject(w, QScriptEngine::ScriptOwnership); v.setProperty("winId", engine->newVariant(QVariant::fromValue((WId)w->winId()))); return v; }
So, the problem is that QScript is not automatically removing the connections of objects that have been deleted. I would expect this to work because it works with C++ objects.