Problem: throwing version of new called

Solution: Pass (std::nothrow) as done in all other places.
This commit is contained in:
Thomas Braun
2017-03-27 22:47:42 +02:00
parent 634c69abd3
commit 19f30f7926
4 changed files with 10 additions and 7 deletions

View File

@@ -36,6 +36,7 @@
#include "atomic_counter.hpp"
#include "atomic_ptr.hpp"
#include <assert.h>
#include <new>
#include <stdint.h>
#if !defined ZMQ_HAVE_WINDOWS
@@ -75,7 +76,7 @@ unsigned long zmq_stopwatch_stop (void *watch_)
void *zmq_threadstart(zmq_thread_fn* func, void* arg)
{
zmq::thread_t* thread = new zmq::thread_t;
zmq::thread_t* thread = new (std::nothrow) zmq::thread_t;
thread->start(func, arg);
return thread;
}
@@ -265,7 +266,7 @@ int zmq_curve_public (char *z85_public_key, const char *z85_secret_key)
void *zmq_atomic_counter_new (void)
{
zmq::atomic_counter_t *counter = new zmq::atomic_counter_t;
zmq::atomic_counter_t *counter = new (std::nothrow) zmq::atomic_counter_t;
alloc_assert (counter);
return counter;
}