Browse Source

[2916] corrected handling of aux socket wrt exception safety

JINMEI Tatuya 12 years ago
parent
commit
7185b57ec3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/lib/asiolink/tests/local_socket_unittest.cc

+ 2 - 1
src/lib/asiolink/tests/local_socket_unittest.cc

@@ -200,7 +200,8 @@ TEST_F(LocalSocketTest, asyncPartialRead) {
     ScopedSocket aux_sockpair[2];
     aux_sockpair[0].set(socks[0]);
     aux_sockpair[1].set(socks[1]);
-    LocalSocket aux_sock(io_service_, aux_sockpair[0].release());
+    LocalSocket aux_sock(io_service_, aux_sockpair[0].get());
+    aux_sockpair[0].release();  // on successful construction we should release
     bool aux_callback_called = false;
     aux_sock.asyncRead(boost::bind(&callback, _1, &io_service_,
                                    &aux_callback_called, false), &ch, 1);