diff options
Diffstat (limited to 'src/zmq/zmqabstractnotifier.h')
-rw-r--r-- | src/zmq/zmqabstractnotifier.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h index 887dde7b27..8377a26d3a 100644 --- a/src/zmq/zmqabstractnotifier.h +++ b/src/zmq/zmqabstractnotifier.h @@ -7,10 +7,14 @@ #include <zmq/zmqconfig.h> +#include <util/memory.h> + +#include <memory> + class CBlockIndex; class CZMQAbstractNotifier; -typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)(); +using CZMQNotifierFactory = std::unique_ptr<CZMQAbstractNotifier> (*)(); class CZMQAbstractNotifier { @@ -21,9 +25,9 @@ public: virtual ~CZMQAbstractNotifier(); template <typename T> - static CZMQAbstractNotifier* Create() + static std::unique_ptr<CZMQAbstractNotifier> Create() { - return new T(); + return MakeUnique<T>(); } std::string GetType() const { return type; } |