25
25
#include < boost/thread.hpp>
26
26
#include < boost/algorithm/string/case_conv.hpp> // for to_upper()
27
27
28
+ #include < memory> // for unique_ptr
29
+
28
30
using namespace RPCServer ;
29
31
using namespace std ;
30
32
@@ -34,9 +36,8 @@ static std::string rpcWarmupStatus("RPC server started");
34
36
static CCriticalSection cs_rpcWarmup;
35
37
/* Timer-creating functions */
36
38
static RPCTimerInterface* timerInterface = NULL ;
37
- /* Map of name to timer.
38
- * @note Can be changed to std::unique_ptr when C++11 */
39
- static std::map<std::string, boost::shared_ptr<RPCTimerBase> > deadlineTimers;
39
+ /* Map of name to timer. */
40
+ static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers;
40
41
41
42
static struct CRPCSignals
42
43
{
@@ -490,7 +491,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
490
491
throw JSONRPCError (RPC_INTERNAL_ERROR, " No timer handler registered for RPC" );
491
492
deadlineTimers.erase (name);
492
493
LogPrint (" rpc" , " queue run of timer %s in %i seconds (using %s)\n " , name, nSeconds, timerInterface->Name ());
493
- deadlineTimers.insert (std::make_pair (name, boost::shared_ptr <RPCTimerBase>(timerInterface->NewTimer (func, nSeconds*1000 ))));
494
+ deadlineTimers.insert (std::make_pair (name, std::unique_ptr <RPCTimerBase>(timerInterface->NewTimer (func, nSeconds*1000 ))));
494
495
}
495
496
496
497
CRPCTable tableRPC;
0 commit comments