mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 00:10:59 +01:00
ircd::net: Assert proper socket object semantics.
This commit is contained in:
parent
345870feb9
commit
8bf0b4d093
2 changed files with 3 additions and 0 deletions
|
@ -108,6 +108,8 @@ struct ircd::net::socket
|
|||
// Socket cannot be copied or moved; must be constructed as shared ptr
|
||||
socket(socket &&) = delete;
|
||||
socket(const socket &) = delete;
|
||||
socket &operator=(socket &&) = delete;
|
||||
socket &operator=(const socket &) = delete;
|
||||
~socket() noexcept;
|
||||
};
|
||||
|
||||
|
|
|
@ -1330,6 +1330,7 @@ ircd::net::socket::socket(asio::ssl::context &ssl,
|
|||
ircd::net::socket::~socket()
|
||||
noexcept try
|
||||
{
|
||||
assert(instances > 0);
|
||||
if(unlikely(--instances == 0))
|
||||
net::dock.notify_all();
|
||||
|
||||
|
|
Loading…
Reference in a new issue