summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@nokia.com>2011-05-09 09:02:54 +0200
committerRainer Keller <rainer.keller@nokia.com>2011-05-09 09:52:09 +0200
commit857868dc1ceeb486226f2e015ef055a254aa4fef (patch)
tree83213187b9abda289fcbfaa9b801663f41242b14 /src
parent9be05cecee03f6a25e041ead61a4f5fab19a297f (diff)
Don't use application when connection to it fails.
Task-number: QTSIM-186 Reviewed-by: owolff Reviewed-by: ckamm
Diffstat (limited to 'src')
-rw-r--r--src/other/application.cpp1
-rw-r--r--src/other/applicationmanager.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/other/application.cpp b/src/other/application.cpp
index 1352bda..083265e 100644
--- a/src/other/application.cpp
+++ b/src/other/application.cpp
@@ -60,6 +60,7 @@ Application::Application(const QString &name, int id, qint64 pid, QLocalSocket *
sendSocket = new QLocalSocket(this);
sendSocket->connectToServer(QtSimulatorPrivate::qt_applicationServerName(pid));
+ sendSocket->waitForConnected(); // don't check return value
QtSimulatorPrivate::qt_registerUserTypes();
}
diff --git a/src/other/applicationmanager.cpp b/src/other/applicationmanager.cpp
index dd3b63e..c1697ee 100644
--- a/src/other/applicationmanager.cpp
+++ b/src/other/applicationmanager.cpp
@@ -271,6 +271,11 @@ void ApplicationManager::handleConnection()
gAppIdCounter++;
Application *app = new Application(QString::fromLatin1(cmd.request.applicationName),
cmd.reply.appId, cmd.request.applicationPid, socket, this);
+ if ( !app->socket()->isOpen()) {
+ qWarning("Could not connect to application: Make sure %s has read/write permissions to the application socket.", qPrintable(qApp->applicationName()));
+ delete app;
+ return;
+ }
VersionStruct version;
version = cmd.request.version;
app->setClientVersion(version);