mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
doc: Add and fix comments about never destroyed objects
This commit is contained in:
@@ -95,6 +95,8 @@ struct LockData {
|
||||
LockData& GetLockData() {
|
||||
// This approach guarantees that the object is not destroyed until after its last use.
|
||||
// The operating system automatically reclaims all the memory in a program's heap when that program exits.
|
||||
// Since the ~LockData() destructor is never called, the LockData class and all
|
||||
// its subclasses must have implicitly-defined destructors.
|
||||
static LockData& lock_data = *new LockData();
|
||||
return lock_data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user