From 8aa0908635f255e2d533539d5330b92b62dc88ba Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 15 Dec 2009 23:49:55 +0100 Subject: all news converted to nothrow variant --- src/app_thread.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/app_thread.cpp') diff --git a/src/app_thread.cpp b/src/app_thread.cpp index 308fc36..666116f 100644 --- a/src/app_thread.cpp +++ b/src/app_thread.cpp @@ -17,6 +17,7 @@ along with this program. If not, see . */ +#include #include #include "../bindings/c/zmq.h" @@ -65,11 +66,11 @@ zmq::app_thread_t::app_thread_t (dispatcher_t *dispatcher_, int thread_slot_, last_processing_time (0) { if (flags_ & ZMQ_POLL) { - signaler = new fd_signaler_t; + signaler = new (std::nothrow) fd_signaler_t; zmq_assert (signaler); } else { - signaler = new ypollset_t; + signaler = new (std::nothrow) ypollset_t; zmq_assert (signaler); } } @@ -163,31 +164,31 @@ zmq::socket_base_t *zmq::app_thread_t::create_socket (int type_) socket_base_t *s = NULL; switch (type_) { case ZMQ_P2P: - s = new p2p_t (this); + s = new (std::nothrow) p2p_t (this); break; case ZMQ_PUB: - s = new pub_t (this); + s = new (std::nothrow) pub_t (this); break; case ZMQ_SUB: - s = new sub_t (this); + s = new (std::nothrow) sub_t (this); break; case ZMQ_REQ: - s = new req_t (this); + s = new (std::nothrow) req_t (this); break; case ZMQ_REP: - s = new rep_t (this); + s = new (std::nothrow) rep_t (this); break; case ZMQ_XREQ: - s = new xreq_t (this); + s = new (std::nothrow) xreq_t (this); break; case ZMQ_XREP: - s = new xrep_t (this); + s = new (std::nothrow) xrep_t (this); break; case ZMQ_UPSTREAM: - s = new upstream_t (this); + s = new (std::nothrow) upstream_t (this); break; case ZMQ_DOWNSTREAM: - s = new downstream_t (this); + s = new (std::nothrow) downstream_t (this); break; default: // TODO: This should be EINVAL. -- cgit v1.2.3