]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Message: use RefCountedObject ctor to set initial ref count
authorSage Weil <sage@inktank.com>
Tue, 1 Jul 2014 22:50:33 +0000 (15:50 -0700)
committerSage Weil <sage@inktank.com>
Thu, 3 Jul 2014 21:28:26 +0000 (14:28 -0700)
Also, drop the useless assert in the dtor (the RefCountedObject dtor does
the same).

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/Message.h

index 0205eed957e96251305098ac01ffd57a438261d5..191263f482f539c0f94ab1896f037aae4d37640f 100644 (file)
@@ -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)