mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
define a macro for heap object deletion in a unified manner (related to issue #1524)
This commit is contained in:
11
src/msg.cpp
11
src/msg.cpp
@@ -235,9 +235,11 @@ int zmq::msg_t::close ()
|
||||
}
|
||||
}
|
||||
|
||||
if (u.base.metadata != NULL)
|
||||
if (u.base.metadata->drop_ref ())
|
||||
delete u.base.metadata;
|
||||
if (u.base.metadata != NULL) {
|
||||
if (u.base.metadata->drop_ref ()) {
|
||||
LIBZMQ_DELETE(u.base.metadata);
|
||||
}
|
||||
}
|
||||
|
||||
// Make the message invalid.
|
||||
u.base.type = 0;
|
||||
@@ -392,8 +394,7 @@ void zmq::msg_t::reset_metadata ()
|
||||
{
|
||||
if (u.base.metadata) {
|
||||
if (u.base.metadata->drop_ref ())
|
||||
delete u.base.metadata;
|
||||
u.base.metadata = NULL;
|
||||
LIBZMQ_DELETE(u.base.metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user