doc: Add and fix comments about never destroyed objects

This commit is contained in:
Hennadii Stepanov
2020-05-22 15:45:21 +03:00
parent 26c093a995
commit 90eb027204
2 changed files with 4 additions and 2 deletions

View File

@@ -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;
}