CIgnoreLeaks

Description

The CIgnoreLeaks class allows you to temporarily suppress leak detection within a specific scope. All allocations performed while an instance of CIgnoreLeaks is alive are ignored by Deleaker.

This is useful when you intentionally allocate memory or resources that should not appear in leak reports.

#include "DeleakerClientApi.h"
 
Singleton* _singleton;
 
void f()
{
    // Allocations inside this scope are not monitored by Deleaker
    // because a CIgnoreLeaks instance is active
    {
        DeleakerClientApi::CIgnoreLeaks ignoreLeaks;
 
        _singleton = new Singleton(); // This allocation will not be reported as a leak
    }
}