From 90eb027204f5a9d7c00fa97d4112243bd37a9012 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 22 May 2020 15:45:21 +0300 Subject: doc: Add and fix comments about never destroyed objects --- src/sync.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sync.cpp') diff --git a/src/sync.cpp b/src/sync.cpp index 9b0878bbea..c3312b5a00 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -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; } -- cgit v1.2.3