From cecec2e2ce335a62e1fa3eb80a9b45c2d2e6c822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 2 Feb 2012 11:02:01 +0100 Subject: Fix qmlscene segfault on startup on Mac OS 10.6. Task-number: QTBUG-23982 The platform plugin loader was searching for plugins in qtbase/bin and would segfault when checking if the qmlscene binary was a plugin. Test if "../Plugins" actually exists before setting it as the platform plugin path. Change-Id: Ibd887b5c5045d23e3eb62867dc7598e09d3918ad Reviewed-by: Bradley T. Hughes Reviewed-by: Sarah Jane Smith Reviewed-by: Gunnar Sletta --- src/gui/kernel/qguiapplication.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 4096628d93..b1cbb5fcae 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -384,8 +385,9 @@ void QGuiApplicationPrivate::createPlatformIntegration() // TODO (msorvig): Create proper cross-platform solution for loading // deployed platform plugins #ifdef Q_OS_MAC - if (platformPluginPath.isEmpty()) { - platformPluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/"); + const QString bundlePluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/"); + if (platformPluginPath.isEmpty() && QDir(bundlePluginPath).exists()) { + platformPluginPath = bundlePluginPath; } #endif -- cgit v1.2.3