doc: Add and fix comments about never destroyed objects
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -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