diff options
author | Brett Stottlemyer <bstottle@ford.com> | 2015-03-07 11:54:41 -0500 |
---|---|---|
committer | Brett Stottlemyer <bstottle@ford.com> | 2015-03-09 23:08:07 +0000 |
commit | a543216863645e360c85ba1a799291c075fa9632 (patch) | |
tree | 390ba82b9e0d7345b19610b7810d068fc3a2ed57 /src/remoteobjects/qremoteobjectregistry.cpp | |
parent | 9b33201c3120457447e1bbd6a66ec8be51bdcd84 (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.cpp | 5 |
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)"); |