[#absl-IgnoreLeak]
= xref:absl.adoc[absl]::IgnoreLeak
:relfileprefix: ../
:mrdocs:

Instruct the leak sanitizer to ignore leak warnings on the object referenced by the passed pointer, as well as all heap objects transitively referenced by it&period; The passed object pointer can point to either the beginning of the object or anywhere within it&period;

== Synopsis

Declared in `&lt;absl&sol;debugging&sol;leak&lowbar;check&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename T&gt;
T*
IgnoreLeak(T* ptr);
----

== Description

Example&colon;

static T&ast; obj &equals; IgnoreLeak(new T(&period;&period;&period;))&semi;

If the passed `ptr` does not point to an actively allocated object at the time `IgnoreLeak()` is called, the call is a no&hyphen;op&semi; if it is actively allocated, leak sanitizer will assume this object is referenced even if there is no actual reference in user memory&period;

== Return Value

The same pointer that was passed in&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ptr*
| Pointer to the object whose leaks should be ignored&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
