Skip to content

Commit

Permalink
Remove unnecessary delete guards (Closes #245)
Browse files Browse the repository at this point in the history
  • Loading branch information
cinemast committed Oct 29, 2018
1 parent f909e2a commit ae1a76f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/jsonrpccpp/client/connectors/tcpsocketclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ TcpSocketClient::TcpSocketClient(const std::string &ipToConnect,
}

TcpSocketClient::~TcpSocketClient() {
if (this->realSocket != NULL) {
delete this->realSocket;
this->realSocket = NULL;
}
delete this->realSocket;
}

void TcpSocketClient::SendRPCMessage(const std::string &message,
Expand Down
5 changes: 1 addition & 4 deletions src/jsonrpccpp/server/connectors/tcpsocketserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ TcpSocketServer::TcpSocketServer(const std::string &ipToBind,
}

TcpSocketServer::~TcpSocketServer() {
if (this->realSocket != NULL) {
delete this->realSocket;
this->realSocket = NULL;
}
delete this->realSocket;
}

bool TcpSocketServer::StartListening() {
Expand Down

0 comments on commit ae1a76f

Please sign in to comment.