mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-10 07:56:09 +00:00
useless checks were removed
This commit is contained in:
parent
23e58e30d5
commit
7a960ff29c
@ -74,14 +74,12 @@ zmq::ctx_t::~ctx_t ()
|
|||||||
delete io_threads [i];
|
delete io_threads [i];
|
||||||
|
|
||||||
// Deallocate the reaper thread object.
|
// Deallocate the reaper thread object.
|
||||||
if (reaper)
|
delete reaper;
|
||||||
delete reaper;
|
|
||||||
|
|
||||||
// Deallocate the array of mailboxes. No special work is
|
// Deallocate the array of mailboxes. No special work is
|
||||||
// needed as mailboxes themselves were deallocated with their
|
// needed as mailboxes themselves were deallocated with their
|
||||||
// corresponding io_thread/socket objects.
|
// corresponding io_thread/socket objects.
|
||||||
if (slots)
|
free (slots);
|
||||||
free (slots);
|
|
||||||
|
|
||||||
// Remove the tag, so that the object is considered dead.
|
// Remove the tag, so that the object is considered dead.
|
||||||
tag = ZMQ_CTX_TAG_VALUE_BAD;
|
tag = ZMQ_CTX_TAG_VALUE_BAD;
|
||||||
|
@ -54,8 +54,7 @@ zmq::mtrie_t::~mtrie_t ()
|
|||||||
else
|
else
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
for (unsigned short i = 0; i != count; ++i)
|
for (unsigned short i = 0; i != count; ++i)
|
||||||
if (next.table [i])
|
delete next.table [i];
|
||||||
delete next.table [i];
|
|
||||||
free (next.table);
|
free (next.table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,7 @@ zmq::session_base_t::~session_base_t ()
|
|||||||
if (engine)
|
if (engine)
|
||||||
engine->terminate ();
|
engine->terminate ();
|
||||||
|
|
||||||
if (addr)
|
delete addr;
|
||||||
delete addr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::session_base_t::attach_pipe (pipe_t *pipe_)
|
void zmq::session_base_t::attach_pipe (pipe_t *pipe_)
|
||||||
|
@ -114,12 +114,9 @@ zmq::stream_engine_t::~stream_engine_t ()
|
|||||||
int rc = tx_msg.close ();
|
int rc = tx_msg.close ();
|
||||||
errno_assert (rc == 0);
|
errno_assert (rc == 0);
|
||||||
|
|
||||||
if (encoder != NULL)
|
delete encoder;
|
||||||
delete encoder;
|
delete decoder;
|
||||||
if (decoder != NULL)
|
delete mechanism;
|
||||||
delete decoder;
|
|
||||||
if (mechanism != NULL)
|
|
||||||
delete mechanism;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
|
void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
|
||||||
|
@ -48,8 +48,7 @@ zmq::trie_t::~trie_t ()
|
|||||||
else
|
else
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
for (unsigned short i = 0; i != count; ++i)
|
for (unsigned short i = 0; i != count; ++i)
|
||||||
if (next.table [i])
|
delete next.table [i];
|
||||||
delete next.table [i];
|
|
||||||
free (next.table);
|
free (next.table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,7 @@ namespace zmq
|
|||||||
}
|
}
|
||||||
|
|
||||||
chunk_t *sc = spare_chunk.xchg (NULL);
|
chunk_t *sc = spare_chunk.xchg (NULL);
|
||||||
if (sc)
|
free (sc);
|
||||||
free (sc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns reference to the front element of the queue.
|
// Returns reference to the front element of the queue.
|
||||||
@ -156,8 +155,7 @@ namespace zmq
|
|||||||
// so for cache reasons we'll get rid of the spare and
|
// so for cache reasons we'll get rid of the spare and
|
||||||
// use 'o' as the spare.
|
// use 'o' as the spare.
|
||||||
chunk_t *cs = spare_chunk.xchg (o);
|
chunk_t *cs = spare_chunk.xchg (o);
|
||||||
if (cs)
|
free (cs);
|
||||||
free (cs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user