diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/script/bridge/qscriptobject.cpp | 6 | ||||
-rw-r--r-- | src/script/bridge/qscriptobject_p.h | 3 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp index a8bd798..a550d39 100644 --- a/src/script/bridge/qscriptobject.cpp +++ b/src/script/bridge/qscriptobject.cpp @@ -41,6 +41,7 @@ #include "config.h" #include "qscriptobject_p.h" +#include "private/qobject_p.h" QT_BEGIN_NAMESPACE @@ -144,6 +145,11 @@ void QScriptObject::getPropertyNames(JSC::ExecState* exec, JSC::PropertyNameArra void QScriptObject::mark() { Q_ASSERT(!marked()); + if (!d) + d = new Data(); + if (d->isMarking) + return; + QBoolBlocker markBlocker(d->isMarking, true); if (d && d->data && !d->data.marked()) d->data.mark(); if (!d || !d->delegate) { diff --git a/src/script/bridge/qscriptobject_p.h b/src/script/bridge/qscriptobject_p.h index a905234..d499c61 100644 --- a/src/script/bridge/qscriptobject_p.h +++ b/src/script/bridge/qscriptobject_p.h @@ -69,8 +69,9 @@ public: { JSC::JSValue data; // QScriptValue::data QScriptObjectDelegate *delegate; + bool isMarking; // recursion guard - Data() : delegate(0) {} + Data() : delegate(0), isMarking(false) {} ~Data(); }; diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index bb701ce..b7a0e44 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -266,9 +266,8 @@ JSC::CallType QtFunction::getCallData(JSC::CallData &callData) void QtFunction::mark() { Q_ASSERT(!marked()); - if (data->object && !data->object.marked()) { - JSC::asObject(data->object)->JSC::JSObject::mark(); - } + if (data->object && !data->object.marked()) + data->object.mark(); JSC::InternalFunction::mark(); } |