Skip to content

Commit 90eb027

Browse files
committed
doc: Add and fix comments about never destroyed objects
1 parent 26c093a commit 90eb027

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/logging.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ BCLog::Logger& LogInstance()
2222
* access the logger. When the shutdown sequence is fully audited and tested,
2323
* explicit destruction of these objects can be implemented by changing this
2424
* from a raw pointer to a std::unique_ptr.
25-
* Since the destructor is never called, the logger and all its members must
26-
* have a trivial destructor.
25+
* Since the ~Logger() destructor is never called, the Logger class and all
26+
* its subclasses must have implicitly-defined destructors.
2727
*
2828
* This method of initialization was originally introduced in
2929
* ee3374234c60aba2cc4c5cd5cac1c0aefc2d817c.

src/sync.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ struct LockData {
9595
LockData& GetLockData() {
9696
// This approach guarantees that the object is not destroyed until after its last use.
9797
// The operating system automatically reclaims all the memory in a program's heap when that program exits.
98+
// Since the ~LockData() destructor is never called, the LockData class and all
99+
// its subclasses must have implicitly-defined destructors.
98100
static LockData& lock_data = *new LockData();
99101
return lock_data;
100102
}

0 commit comments

Comments
 (0)