diff --git a/rpc/rpcserver.cpp b/rpc/rpcserver.cpp index e0eb51a..4bb59b4 100644 --- a/rpc/rpcserver.cpp +++ b/rpc/rpcserver.cpp @@ -33,6 +33,8 @@ RpcServer::RpcServer(bool perConnLogs) RpcServer::~RpcServer() { + close(); + emit closed(); } bool RpcServer::registerService(::google::protobuf::Service *service, @@ -73,6 +75,7 @@ void RpcServer::incomingConnection(qintptr socketDescriptor) connect(this, SIGNAL(notifyClients(int, SharedProtobufMessage)), conn, SLOT(sendNotification(int, SharedProtobufMessage))); + connect(this, SIGNAL(closed()), thread, SLOT(quit())); thread->start(); } diff --git a/rpc/rpcserver.h b/rpc/rpcserver.h index c664512..4508e64 100644 --- a/rpc/rpcserver.h +++ b/rpc/rpcserver.h @@ -44,6 +44,7 @@ public: QHostAddress address, quint16 tcpPortNum); signals: + void closed(); void notifyClients(int notifType, SharedProtobufMessage notifData); protected: