mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
doc: Add and fix comments about never destroyed objects
This commit is contained in:
parent
26c093a995
commit
90eb027204
2 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue