summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qafbwebsocketclient.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/qafbwebsocketclient.cpp b/qafbwebsocketclient.cpp
index 0cbc274..c0e5e71 100644
--- a/qafbwebsocketclient.cpp
+++ b/qafbwebsocketclient.cpp
@@ -85,8 +85,9 @@ void QAfbWebsocketClient::close()
*/
void QAfbWebsocketClient::call(const QString& api, const QString& verb, const QJsonValue& arg, closure_t closure)
{
- QString callId = QString::number(m_nextCallId);
- m_closures[callId] = closure;
+ QString callId = QString::number(m_nextCallId++);
+ if (closure)
+ m_closures[callId] = closure;
QJsonArray msg;
msg.append(2); // Call
@@ -94,8 +95,6 @@ void QAfbWebsocketClient::call(const QString& api, const QString& verb, const QJ
msg.append(api + "/" + verb);
msg.append(arg);
- m_nextCallId++;
-
QJsonDocument value;
value.setArray(msg);