소스 검색

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 년 전
부모
커밋
624aca8d62
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;