diff options
author | mfekari <mfekari@rim.com> | 2012-11-27 14:35:08 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-29 18:59:42 (GMT) |
commit | a1a4e13a83178dd94fd778f927caf5ccb75de42b (patch) | |
tree | 20f5182782625c3044d7069cd31c1a8546395746 /src/corelib | |
parent | 8df554a7fae0ac57386774098de7f396e0b54809 (diff) | |
download | Qt-a1a4e13a83178dd94fd778f927caf5ccb75de42b.zip Qt-a1a4e13a83178dd94fd778f927caf5ccb75de42b.tar.gz Qt-a1a4e13a83178dd94fd778f927caf5ccb75de42b.tar.bz2 |
Qnx: Check if QCoreApplication::instance() exists before using QSocketNotifier
This is a back port from: 5e59215ac649190a5b86f9af283d0cf41b88b3bf
Change-Id: I889f8b69a0c81a5e0ed71d28a65279fe6e238e2f
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qlocale_unix.cpp | 7 |
1 files 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 <QtCore/private/qcore_unix_p.h> +#include <QCoreApplication> #include <unistd.h> #include <errno.h> @@ -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 |