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.
Declared in <absl/debugging/leak_check.h>
class LeakCheckDisabler;
Example:
void Foo() { LeakCheckDisabler disabler; ... code that allocates objects whose leaks should be ignored ... }
REQUIRES: Destructor runs in same thread as constructor
| Name | Description |
|---|---|
LeakCheckDisabler [constructor] | Constructors |
~LeakCheckDisabler [destructor] | Destroys the disabler, re-enabling leak checking for the current thread. |
operator= [deleted] | Deleted copy assignment; the disabler is not copyable. |