This helper class indicates that any heap allocations done in the code block covered by the scoped object, which should be allocated on the stack, will not be reported as leaks. Leak check disabling will occur within the code block and any nested function calls within the code block.
Synopsis
Declared in <absl/debugging/leak_check.h>
class LeakCheckDisabler;
Description
Example:
void Foo() { LeakCheckDisabler disabler; ... code that allocates objects whose leaks should be ignored ... }
REQUIRES: Destructor runs in same thread as constructor
Member Functions
Name |
Description |
|
Constructors |
|
Destroys the disabler, re‐enabling leak checking for the current thread. |
|
Deleted copy assignment; the disabler is not copyable. |
Created with MrDocs