mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
xpub: free received subscription messages
This commit is contained in:
@@ -56,14 +56,11 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
|
|||||||
{
|
{
|
||||||
// There are some subscriptions waiting. Let's process them.
|
// There are some subscriptions waiting. Let's process them.
|
||||||
msg_t sub;
|
msg_t sub;
|
||||||
sub.init ();
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
// Grab next subscription.
|
// Grab next subscription.
|
||||||
if (!pipe_->read (&sub)) {
|
if (!pipe_->read (&sub))
|
||||||
sub.close ();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// Apply the subscription to the trie.
|
// Apply the subscription to the trie.
|
||||||
unsigned char *data = (unsigned char*) sub.data ();
|
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 (),
|
pending.push_back (blob_t ((unsigned char*) sub.data (),
|
||||||
sub.size ()));
|
sub.size ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user