From a1a4e13a83178dd94fd778f927caf5ccb75de42b Mon Sep 17 00:00:00 2001 From: mfekari Date: Tue, 27 Nov 2012 09:35:08 -0500 Subject: Qnx: Check if QCoreApplication::instance() exists before using QSocketNotifier This is a back port from: 5e59215ac649190a5b86f9af283d0cf41b88b3bf Change-Id: I889f8b69a0c81a5e0ed71d28a65279fe6e238e2f Reviewed-by: Peter Hartmann --- src/corelib/tools/qlocale_unix.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index 174d739..87cd112 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -48,6 +48,7 @@ #if defined(Q_OS_QNX) #include +#include #include #include @@ -113,9 +114,11 @@ void QBBLocaleData::readPPSLocale() return; } - ppsNotifier = new QSocketNotifier(ppsFd, QSocketNotifier::Read, this); updateMesurementSystem(); - QObject::connect(ppsNotifier, SIGNAL(activated(int)), this, SLOT(updateMesurementSystem())); + if (QCoreApplication::instance()) { + ppsNotifier = new QSocketNotifier(ppsFd, QSocketNotifier::Read, this); + QObject::connect(ppsNotifier, SIGNAL(activated(int)), this, SLOT(updateMesurementSystem())); + } } #endif -- cgit v0.12