Skip to content

Commit a4ecaad

Browse files
committed
Use std::unique_ptr
1 parent 1bcb07f commit a4ecaad

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/validationinterface.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ struct CMainSignalsInstance {
7979
static CMainSignals g_signals;
8080

8181
CMainSignals::CMainSignals() {
82-
internals = new CMainSignalsInstance();
83-
}
84-
85-
CMainSignals::~CMainSignals() {
86-
delete internals;
82+
internals.reset(new CMainSignalsInstance());
8783
}
8884

8985
void CMainSignals::RegisterBackgroundSignalScheduler(CScheduler& scheduler) {

src/validationinterface.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,14 @@ class CValidationInterface {
7070
struct CMainSignalsInstance;
7171
class CMainSignals {
7272
private:
73-
CMainSignalsInstance* internals;
73+
std::unique_ptr<CMainSignalsInstance> internals;
7474

7575
friend void ::RegisterValidationInterface(CValidationInterface*);
7676
friend void ::UnregisterValidationInterface(CValidationInterface*);
7777
friend void ::UnregisterAllValidationInterfaces();
7878

7979
public:
8080
CMainSignals();
81-
~CMainSignals();
8281

8382
/** Register a CScheduler to give callbacks which should run in the background (may only be called once) */
8483
void RegisterBackgroundSignalScheduler(CScheduler& scheduler);

0 commit comments

Comments
 (0)