summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-01 07:35:15 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-01 07:35:15 +0200
commit47c064f2eaa01c324e06588a4f07892762e78fcd (patch)
tree36cda4840cfe3c863b267aad91d8b0c6b3437009 /src
parent090e460d6f09b5611d34a4867efb6cf46dd44a34 (diff)
hangup when closing socket with no pipes attached -- fixed
Diffstat (limited to 'src')
-rw-r--r--src/fq.cpp5
-rw-r--r--src/lb.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/fq.cpp b/src/fq.cpp
index 5673796..7eef564 100644
--- a/src/fq.cpp
+++ b/src/fq.cpp
@@ -75,6 +75,11 @@ void zmq::fq_t::terminate ()
{
terminating = true;
+ if (pipes.empty ()) {
+ sink->terminated ();
+ return;
+ }
+
for (pipes_t::size_type i = 0; i != pipes.size (); i++)
pipes [i]->terminate ();
}
diff --git a/src/lb.cpp b/src/lb.cpp
index 2468b48..53f8f58 100644
--- a/src/lb.cpp
+++ b/src/lb.cpp
@@ -54,6 +54,11 @@ void zmq::lb_t::terminate ()
{
terminating = true;
+ if (pipes.empty ()) {
+ sink->terminated ();
+ return;
+ }
+
for (pipes_t::size_type i = 0; i != pipes.size (); i++)
pipes [i]->terminate ();
}