0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-29 00:32:34 +08:00

Merge pull request #233 from danielnorberg/master

LIBZMQ-300: free received subscription messages
This commit is contained in:
Pieter Hintjens 2012-02-03 02:12:09 -08:00
commit dc50bf5dca

View File

@ -56,14 +56,11 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
{
// There are some subscriptions waiting. Let's process them.
msg_t sub;
sub.init ();
while (true) {
// Grab next subscription.
if (!pipe_->read (&sub)) {
sub.close ();
if (!pipe_->read (&sub))
return;
}
// Apply the subscription to the trie.
unsigned char *data = (unsigned char*) sub.data ();
@ -81,6 +78,8 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
pending.push_back (blob_t ((unsigned char*) sub.data (),
sub.size ()));
}
sub.close()
}
}