qqmlimport: avoid deadlock by scoping the usage of QWriteLocker
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>
Tue, 15 Oct 2013 08:10:20 +0000 (10:10 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 15 Oct 2013 23:28:12 +0000 (01:28 +0200)
commit4e45120a7b593cfafccb5cd7b7c7645afffc37c4
treee3e62b8321b396a20ba753167fcf23036f3a4c12
parent473960dd613e91003032a57b708cc4d6d582ed9a
qqmlimport: avoid deadlock by scoping the usage of QWriteLocker

Change a9cf828559b00bc70f59250b7f3cf38458774715 refactored
QQmlImportDatabase::importPlugin() to be used for both dynamic
and static plugin loading. In the process, the scope of a
QWriteLocker protecting a call to registerTypes ended up to wide.
That caused a deadlock to occur for some static qml applications
since the lock remained active during a subsequent call to
initializeEngine.

So narrow the the scope down to be exactly as it wore before the
change. This will remove the deadlock.

Change-Id: Ibb15c953c0f693fe75dab24f0093c3bddb3f0cbb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/qqmlimport.cpp