diff options
author | Tim Cooper <tim.cooper@layeh.com> | 2016-03-25 20:04:31 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-05-08 17:45:52 +0300 |
commit | 21f9a29d42aee8e6daa84a8262f0c01ce3c79154 (patch) | |
tree | 41f76a47c101c7768e61947e864121ca898adfb4 /src/murmur/MurmurGRPCImpl.h | |
parent | 1af50bd5ff865c5f065e828109ece807028e9bfd (diff) |
grpc: fix uninitialized RPCCall reference count
Diffstat (limited to 'src/murmur/MurmurGRPCImpl.h')
-rw-r--r-- | src/murmur/MurmurGRPCImpl.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/murmur/MurmurGRPCImpl.h b/src/murmur/MurmurGRPCImpl.h index 5f1103615..de5b180d5 100644 --- a/src/murmur/MurmurGRPCImpl.h +++ b/src/murmur/MurmurGRPCImpl.h @@ -119,7 +119,7 @@ public: MurmurRPCImpl *rpc; ::grpc::ServerContext context; - RPCCall(MurmurRPCImpl *rpcImpl) : rpc(rpcImpl) { + RPCCall(MurmurRPCImpl *rpcImpl) : m_refs(0), rpc(rpcImpl) { ref(); } virtual ~RPCCall() { @@ -136,7 +136,8 @@ public: } virtual void deref() { - if (--m_refs <= 0) { + Q_ASSERT(m_refs > 0); + if (--m_refs == 0) { delete this; } } |