Kaynağa Gözat

Assign Abstract client as a parent of its AsyncReply(ies)

- If client died before async is finished or failed, memory leak occured
Viktor Kopp 5 yıl önce
ebeveyn
işleme
624aca8d62
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      src/grpc/abstractclient.cpp

+ 1 - 1
src/grpc/abstractclient.cpp

@@ -71,7 +71,7 @@ bool AbstractClient::call(const QString &method, const QByteArray &arg, QByteArr
 
 AsyncReply *AbstractClient::call(const QString &method, const QByteArray &arg)
 {
-    AsyncReply *reply = new AsyncReply(d->channel);
+    AsyncReply *reply = new AsyncReply(d->channel, this);
 
     if (!d->channel) {
         d->lastError = AbstractChannel::Unknown;