Don't crash during QApplication construction
authorBradley T. Hughes <bradley.hughes@nokia.com>
Wed, 11 Jan 2012 13:23:05 +0000 (14:23 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Jan 2012 13:38:29 +0000 (14:38 +0100)
commita43986e2a5229aa32e9383677cd8e036a0e7c0b7
tree2e5bd0b9008a5599d42d0137a625a426d5ece461
parent9834b3681fb02ef5eaab19d678b674365a4381e4
Don't crash during QApplication construction

The QCoreApplication::init() function calls the virtual
QCoreApplicationPrivate::createEventDispatcher(), which for
QApplication, also creates the plaform integration. Unfortunately, the
Cocoa menubar integration uses qApp before QApplication is constructed,
causing a crash. Circumvent this by using QGuiApplicationPrivate
directly.

Change-Id: Ib36f628641761e70f9e9e39dd23e70e7537a165b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
src/plugins/platforms/cocoa/qcocoahelpers.mm