3 次代码提交 072af6ab32 ... 51615ca6bb

作者 SHA1 备注 提交日期
  Alexey Edelev 51615ca6bb Fix handling of gRPC errors when the stream is finished 2 年之前
  Alexey Edelev 7eeae7d11d Fix handling of gRPC errors when the stream is finished 2 年之前
  Alexey Edelev 072af6ab32 Fix handling of gRPC errors when the stream is finished 2 年之前
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/grpc/qabstractgrpcclient.cpp

+ 3 - 0
src/grpc/qabstractgrpcclient.cpp

@@ -66,6 +66,9 @@ void QAbstractGrpcClient::attachChannel(const std::shared_ptr<QAbstractGrpcChann
                            "You have to be confident that channel routines are working in the same thread as QAbstractGrpcClient";
         throw std::runtime_error("Call from another thread");
     }
+    for (auto stream : dPtr->activeStreams) {
+        stream->cancel();
+    }
     dPtr->channel = channel;
     dPtr->serializer = channel->serializer();
     for (auto stream : dPtr->activeStreams) {