absl::LeakCheckDisabler

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

NameDescription
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.