Skip to content

Commit 0f8601c

Browse files
authored
Merge pull request #371 from gummif/gfa/move-ctors
Problem: Move assigned objects still alive
2 parents 5ee8261 + d3abe06 commit 0f8601c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zmq.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ class context_t
644644
context_t(context_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr) { rhs.ptr = ZMQ_NULLPTR; }
645645
context_t &operator=(context_t &&rhs) ZMQ_NOTHROW
646646
{
647+
close();
647648
std::swap(ptr, rhs.ptr);
648649
return *this;
649650
}
@@ -1566,6 +1567,7 @@ class socket_t : public detail::socket_base
15661567
}
15671568
socket_t &operator=(socket_t &&rhs) ZMQ_NOTHROW
15681569
{
1570+
close();
15691571
std::swap(_handle, rhs._handle);
15701572
return *this;
15711573
}

0 commit comments

Comments
 (0)