No need for intermediate weak_ptr
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 11 Feb 2015 16:48:16 +0000 (17:48 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 11 Feb 2015 16:48:16 +0000 (17:48 +0100)
src/icmp/icmppinger.cpp

index 0665040..f8b95fd 100644 (file)
@@ -58,11 +58,10 @@ PingerItem IcmpPinger::create(
     // create pinger
     IcmpPinger *ptr = new IcmpPinger(io_serv, protocol, echo_reply_timeout_in_sec, distributor);
     IcmpPingerItem shared_ptr_(ptr);
-    Pinger::WeakPtr weak_ptr( shared_ptr_ );
 
     // keep weak pointer to self
     //shared_ptr_->set_myself( weak_ptr ); //Error: Pinger::set_myself is protected
-    ptr->set_myself( weak_ptr );
+    ptr->set_myself( shared_ptr_ );
 
     // register in distributor
     distributor->register_pinger(shared_ptr_);