summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dispatcher.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp
index 9e713c2..b830654 100644
--- a/src/dispatcher.cpp
+++ b/src/dispatcher.cpp
@@ -134,11 +134,15 @@ zmq::socket_base_t *zmq::dispatcher_t::create_socket (int type_)
}
threads_sync.unlock ();
+ socket_base_t *s = thread->create_socket (type_);
+ if (!s)
+ return NULL;
+
term_sync.lock ();
sockets++;
term_sync.unlock ();
- return thread->create_socket (type_);
+ return s;
}
void zmq::dispatcher_t::destroy_socket ()