From b0da92b895d9303b46b41b9e76f4096a768a679d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Jul 2014 15:50:33 -0700 Subject: [PATCH] msg/Message: use RefCountedObject ctor to set initial ref count Also, drop the useless assert in the dtor (the RefCountedObject dtor does the same). Signed-off-by: Sage Weil --- src/msg/Message.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/msg/Message.h b/src/msg/Message.h index 0205eed957e..191263f482f 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -191,7 +191,9 @@ public: public: Connection(CephContext *cct, Messenger *m) - : RefCountedObject(cct), + // we are managed exlusively by ConnectionRef; make it so you can + // ConnectionRef foo = new Connection; + : RefCountedObject(cct, 0), lock("Connection::lock"), msgr(m), priv(NULL), @@ -200,9 +202,6 @@ public: pipe(NULL), failed(false), rx_buffers_version(0) { - // we are managed exlusively by ConnectionRef; make it so you can - // ConnectionRef foo = new Connection; - nref.set(0); } ~Connection() { //generic_dout(0) << "~Connection " << this << dendl; @@ -372,7 +371,6 @@ public: protected: virtual ~Message() { - assert(nref.read() == 0); if (byte_throttler) byte_throttler->put(payload.length() + middle.length() + data.length()); if (msg_throttler) -- 2.47.3