Fix crash with recursively loading cached compilation units
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 24 Jun 2014 08:35:42 +0000 (10:35 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Fri, 22 Aug 2014 19:13:44 +0000 (21:13 +0200)
commite59482f7f56fcb91bccff7230bed308e2687078e
tree48563e76e5da08bd43e1cf10db2908a902820ce0
parent74325015e7b3bab83826eefb61b9ad1808b1524d
Fix crash with recursively loading cached compilation units

When a cached compilation unit depends on an import that is implemented as a
Qml C++ plugin and that plugin in turn loads an asynchronous component that is
cached, we would get a crash in the typeloader and a failing assertion
(ASSERT: "d->m_mainThreadWaiting == false" in file qml/ftw/qqmlthread.cpp, line 300)

This is because we did not implement the asynchronous loading within the loader
thread for cached compilation units. This is simply done using a posted event,
using the same mechanism used for other async load methods.

Change-Id: Iefce67ab634ce26122c348dcdfc8e66b00fec671
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/qqmltypeloader.cpp
src/qml/qml/qqmltypeloader_p.h