summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ();
}