From: Sage Weil Date: Tue, 1 Jul 2014 22:50:33 +0000 (-0700) Subject: msg/Message: use RefCountedObject ctor to set initial ref count X-Git-Tag: v0.84~148^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b0da92b895d9303b46b41b9e76f4096a768a679d;p=ceph.git 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 --- diff --git a/src/msg/Message.h b/src/msg/Message.h index 0205eed957e9..191263f482f5 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)