2525#include < boost/thread.hpp>
2626#include < boost/algorithm/string/case_conv.hpp> // for to_upper()
2727
28+ #include < memory> // for unique_ptr
29+
2830using namespace RPCServer ;
2931using namespace std ;
3032
@@ -34,9 +36,8 @@ static std::string rpcWarmupStatus("RPC server started");
3436static CCriticalSection cs_rpcWarmup;
3537/* Timer-creating functions */
3638static 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;
4041
4142static struct CRPCSignals
4243{
@@ -490,7 +491,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
490491 throw JSONRPCError (RPC_INTERNAL_ERROR, " No timer handler registered for RPC" );
491492 deadlineTimers.erase (name);
492493 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 ))));
494495}
495496
496497CRPCTable tableRPC;
0 commit comments