From daf710258b1a7333a0aa54860474f6cea5829061 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 14 Aug 2009 10:30:16 +0200 Subject: implement GC marking of qobject sender JS wrapper --- src/script/bridge/qscriptqobject.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index f749e7c..0b3f4fd 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -101,10 +101,11 @@ struct QObjectConnection { if (senderWrapper && !senderWrapper.marked()) { // see if the sender should be marked or not - Q_ASSERT_X(false, Q_FUNC_INFO, "implement me"); -#if 0 - Q_ASSERT(JSC::asObject(senderWrapper)->inherits(&QObjectWrapperObject::info)); - QObjectWrapperObject *inst = static_cast(JSC::asObject(senderWrapper)); + Q_ASSERT(senderWrapper.isObject(&QScriptObject::info)); + QScriptObject *scriptObject = static_cast(JSC::asObject(senderWrapper)); + QScriptObjectDelegate *delegate = scriptObject->delegate(); + Q_ASSERT(delegate && (delegate->type() == QScriptObjectDelegate::QtObject)); + QObjectDelegate *inst = static_cast(delegate); if ((inst->ownership() == QScriptEngine::ScriptOwnership) || ((inst->ownership() == QScriptEngine::AutoOwnership) && inst->value() && !inst->value()->parent())) { @@ -112,7 +113,6 @@ struct QObjectConnection } else { senderWrapper.mark(); } -#endif } if (receiver && !receiver.marked()) receiver.mark(); -- cgit v0.12