define a macro for heap object deletion in a unified manner (related to issue #1524)

This commit is contained in:
reza.ebrahimi
2015-08-17 00:35:11 +04:30
parent 9bf88bcc03
commit 1621c25ef0
19 changed files with 93 additions and 108 deletions

View File

@@ -172,13 +172,15 @@ zmq::stream_engine_t::~stream_engine_t ()
// Drop reference to metadata and destroy it if we are
// the only user.
if (metadata != NULL)
if (metadata->drop_ref ())
delete metadata;
if (metadata != NULL) {
if (metadata->drop_ref ()) {
LIBZMQ_DELETE(metadata);
}
}
delete encoder;
delete decoder;
delete mechanism;
LIBZMQ_DELETE(encoder);
LIBZMQ_DELETE(decoder);
LIBZMQ_DELETE(mechanism);
}
void zmq::stream_engine_t::plug (io_thread_t *io_thread_,