**
****************************************************************************/
+#include <QtCore/QBuffer>
+#include <QtCore/QDebug>
#include "qv4regalloc_p.h"
+ #include "qv4alloca_p.h"
#include <private/qv4value_inl_p.h>
#include <algorithm>
return o->call(callData);
}
-ReturnedValue Runtime::callValue(ExecutionContext *context, const ValueRef func, CallData *callData)
+ReturnedValue Runtime::callValue(ExecutionEngine *engine, const Value &func, CallData *callData)
{
- if (!func->isObject())
- return context->throwTypeError(QStringLiteral("%1 is not a function").arg(func->toQStringNoThrow()));
+ if (!func.isObject())
- return engine->throwTypeError();
++ return engine->throwTypeError(QStringLiteral("%1 is not a function").arg(func.toQStringNoThrow()));
- return func->objectValue()->call(callData);
+ return func.objectValue()->call(callData);
}
#include "qv4objectproto_p.h"
#include "qv4mm_p.h"
#include "qv4scopedvalue_p.h"
-
+ #include "qv4alloca_p.h"
-#include <QtCore/qnumeric.h>
-#include <QtCore/qmath.h>
#include <QtCore/QDateTime>
-#include <QtCore/QStringList>
#include <QtCore/QDebug>
-#include <cmath>
-#include <qmath.h>
-#include <qnumeric.h>
-#include <cassert>
+#include <QtCore/QStringList>
#include <private/qqmljsengine_p.h>
#include <private/qqmljslexer_p.h>
Thus QQmlDataBlob::done() will always eventually be called, even if the blob has an error set.
*/
-/*!
-Create a new QQmlDataLoader for \a engine.
-*/
-QQmlDataLoader::QQmlDataLoader(QQmlEngine *engine)
-: m_engine(engine), m_thread(new QQmlDataLoaderThread(this))
-{
-}
-
-/*! \internal */
-QQmlDataLoader::~QQmlDataLoader()
-{
- invalidate();
-}
-
-void QQmlDataLoader::invalidate()
+void QQmlTypeLoader::invalidate()
{
- for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter)
- (*iter)->release();
- m_networkReplies.clear();
-
if (m_thread) {
shutdownThread();
delete m_thread;
m_thread = 0;
}
+
+ // Need to delete the network replies after
+ // the loader thread is shutdown as it could be
+ // getting new replies while we clear them
+ for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter)
+ (*iter)->release();
+ m_networkReplies.clear();
}
-void QQmlDataLoader::lock()
+void QQmlTypeLoader::lock()
{
m_thread->lock();
}