3 Commits 072af6ab32 ... 51615ca6bb

Author SHA1 Message Date
  Alexey Edelev 51615ca6bb Fix handling of gRPC errors when the stream is finished 2 years ago
  Alexey Edelev 7eeae7d11d Fix handling of gRPC errors when the stream is finished 2 years ago
  Alexey Edelev 072af6ab32 Fix handling of gRPC errors when the stream is finished 2 years ago
1 changed files with 3 additions and 0 deletions
  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";
                            "You have to be confident that channel routines are working in the same thread as QAbstractGrpcClient";
         throw std::runtime_error("Call from another thread");
         throw std::runtime_error("Call from another thread");
     }
     }
+    for (auto stream : dPtr->activeStreams) {
+        stream->cancel();
+    }
     dPtr->channel = channel;
     dPtr->channel = channel;
     dPtr->serializer = channel->serializer();
     dPtr->serializer = channel->serializer();
     for (auto stream : dPtr->activeStreams) {
     for (auto stream : dPtr->activeStreams) {