summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qremoteobjectregistry.cpp
diff options
context:
space:
mode:
authorBrett Stottlemyer <bstottle@ford.com>2015-03-07 11:54:41 -0500
committerBrett Stottlemyer <bstottle@ford.com>2015-03-09 23:08:07 +0000
commita543216863645e360c85ba1a799291c075fa9632 (patch)
tree390ba82b9e0d7345b19610b7810d068fc3a2ed57 /src/remoteobjects/qremoteobjectregistry.cpp
parent9b33201c3120457447e1bbd6a66ec8be51bdcd84 (diff)
Fix registry crash when no registrySource
Prior to this patch, a crash would occur if a Host Node tried to connect to a Registry which wasn't available and used enableRemoting to share a Source. The crash would occur when the Node tried to remove the object from the Registry when deleted. Change-Id: Ibbe6e2e5742179e2d4be7f51917953013054fe0b Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectregistry.cpp')
-rw-r--r--src/remoteobjects/qremoteobjectregistry.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/remoteobjects/qremoteobjectregistry.cpp b/src/remoteobjects/qremoteobjectregistry.cpp
index d136ef9..3cadd97 100644
--- a/src/remoteobjects/qremoteobjectregistry.cpp
+++ b/src/remoteobjects/qremoteobjectregistry.cpp
@@ -88,6 +88,11 @@ void QRemoteObjectRegistry::addSource(const QRemoteObjectSourceLocation &entry)
void QRemoteObjectRegistry::removeSource(const QRemoteObjectSourceLocation &entry)
{
+ if (!isInitialized()) {
+ bool res = waitForSource();
+ if (!res)
+ return; //FIX What to do here?
+ }
qCDebug(QT_REMOTEOBJECT) << "An entry was removed from the registry - Sending to Source" << entry.first << entry.second;
// This does not set any data to avoid a coherency problem between client and server
static int index = QRemoteObjectRegistry::staticMetaObject.indexOfMethod("removeSource(QRemoteObjectSourceLocation)");