Skip to content

Commit

Permalink
Merge pull request #73 from AO-StreetArt/dev
Browse files Browse the repository at this point in the history
ZMQ memory cleanup fixes
  • Loading branch information
AO-StreetArt committed Jun 26, 2017
2 parents d988b76 + 37954bf commit 1383f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aossl/zmq/zmqio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ std::string Zmqi::recv()
// Rebuild the ZeroMQ Message Object
// Close the message object and then re-build, this means that
// any resources from the message MAY NOT BE PRESENT after the next message has been recieved
if (!started) {
if (started) {
request->rebuild();
}

Expand All @@ -81,7 +81,7 @@ char * Zmqi::crecv() {
// Rebuild the ZeroMQ Message Object
// Close the message object and then re-build, this means that
// any resources from the message MAY NOT BE PRESENT after the next message has been recieved
if (!started) {request->rebuild();}
if (started) {request->rebuild();}
if (rcv_cstr) {delete[] rcv_cstr;rcv_cstr=NULL;}

// Wait for next request from client
Expand Down Expand Up @@ -139,6 +139,7 @@ Zmqo::Zmqo(zmq::context_t &context, int connection_type)
Zmqo::~Zmqo()
{
delete zmqo;
if (rcv_cstr) {delete[] rcv_cstr;}
}

//Connect to the Socket
Expand Down

0 comments on commit 1383f0e

Please sign in to comment.