summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-10 13:25:22 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-10 13:25:22 (GMT)
commit7f2fadda40fa79a35e9c77ef4f9613940c23f382 (patch)
treefe14df41ec524307d8726c3ed28564a997122052 /src/script/api
parent75bc0215080fcafea9ba1bafedd980d9ac71bf9d (diff)
downloadQt-7f2fadda40fa79a35e9c77ef4f9613940c23f382.zip
Qt-7f2fadda40fa79a35e9c77ef4f9613940c23f382.tar.gz
Qt-7f2fadda40fa79a35e9c77ef4f9613940c23f382.tar.bz2
don't crash during GC if no prototype has been set for a metatype
Also, have pushContext() return currentContext() for now, to avoid crashing, and disable processing of __postInit__ property in importExtension() for same reason.
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index cd31b8d..f5b798a 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -505,8 +505,10 @@ void GlobalObject::mark()
{
QHash<int, QScriptTypeInfo*>::const_iterator it;
- for (it = engine->m_typeInfos.constBegin(); it != engine->m_typeInfos.constEnd(); ++it)
- (*it)->prototype.mark();
+ for (it = engine->m_typeInfos.constBegin(); it != engine->m_typeInfos.constEnd(); ++it) {
+ if ((*it)->prototype)
+ (*it)->prototype.mark();
+ }
}
}
@@ -1838,7 +1840,7 @@ QScriptContext *QScriptEngine::pushContext()
{
Q_D(QScriptEngine);
qWarning("QScriptEngine::pushContext() not implemented");
- return 0;
+ return d->contextForFrame(d->currentFrame);
#ifndef Q_SCRIPT_NO_EVENT_NOTIFY
// notifyContextPush(); TODO
#endif
@@ -2579,7 +2581,8 @@ QScriptValue QScriptEngine::importExtension(const QString &extension)
}
// if the __postInit__ function has been set, we call it
- QScriptValue postInit = ctx->activationObject().property(QLatin1String("__postInit__"));
+ // ### enable once activationObject() works
+ QScriptValue postInit; // = ctx->activationObject().property(QLatin1String("__postInit__"));
if (postInit.isFunction()) {
postInit.call(globalObject());
if (hasUncaughtException()) {