Skip to content

Commit

Permalink
auto unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Oct 20, 2024
1 parent 4e87ddc commit e0e989b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/simple_socket/UnixDomainSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace {
struct UnixDomainServer::Impl {

explicit Impl(const std::string& domain, int backlog)
: socket(createSocket()) {
: socket(createSocket()), domain(domain) {

unlinkPath(domain);

Expand Down Expand Up @@ -68,12 +68,17 @@ struct UnixDomainServer::Impl {
socket.close();
}

~Impl() {
unlinkPath(domain);
}

private:
#ifdef _WIN32
WSASession session;
#endif

Socket socket;
std::string domain;
};


Expand Down

0 comments on commit e0e989b

Please sign in to comment.