summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authormfekari <mfekari@gmail.com>2012-11-28 04:55:54 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-28 16:21:57 +0100
commit5e59215ac649190a5b86f9af283d0cf41b88b3bf (patch)
tree4de2a60365ef808fda34e7f0b3f03a551a9feb45 /src/corelib/tools
parentbf9691d9b75afe98adc601e6e80c366aa9d1e43a (diff)
Qnx: Check if QCoreApplication::instance() exists before using QSocketNotifier
Change-Id: I9f00314ea1ef73b87bc56ca1f8fcf859c9cd1824 Reviewed-by: Bernd Weimer <bweimer@rim.com> Reviewed-by: Peter Hartmann <phartmann@rim.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qlocale_unix.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp
index b2aaec7c3d..088e40b176 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 <QtCore/private/qcore_unix_p.h>
+#include <QCoreApplication>
#include <unistd.h>
#include <errno.h>
@@ -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