From: mfekari Date: Wed, 28 Nov 2012 09:55:54 +0000 (-0500) Subject: Qnx: Check if QCoreApplication::instance() exists before using QSocketNotifier X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e59215ac649190a5b86f9af283d0cf41b88b3bf;p=profile%2Fivi%2Fqtbase.git Qnx: Check if QCoreApplication::instance() exists before using QSocketNotifier Change-Id: I9f00314ea1ef73b87bc56ca1f8fcf859c9cd1824 Reviewed-by: Bernd Weimer Reviewed-by: Peter Hartmann --- diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index b2aaec7..088e40b 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -49,6 +49,7 @@ #if defined(Q_OS_BLACKBERRY) #include +#include #include #include @@ -114,9 +115,11 @@ void QQNXLocaleData::readPPSLocale() return; } - ppsNotifier = new QSocketNotifier(ppsFd, QSocketNotifier::Read, this); updateMeasurementSystem(); - QObject::connect(ppsNotifier, SIGNAL(activated(int)), this, SLOT(updateMeasurementSystem())); + if (QCoreApplication::instance()) { + ppsNotifier = new QSocketNotifier(ppsFd, QSocketNotifier::Read, this); + QObject::connect(ppsNotifier, SIGNAL(activated(int)), this, SLOT(updateMeasurementSystem())); + } } #endif