[#BloombergLP-bdlma-AutoReleaser] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::AutoReleaser :relfileprefix: ../../ :mrdocs: This class implements a proctor that invokes the `release` method of its managed allocator or pool at destruction unless the proctor's `release` method is invoked. == Synopsis Declared in `<bdlma_autoreleaser.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> class AutoReleaser; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlma/AutoReleaser/2constructor.adoc[`AutoReleaser`] [.small]#[constructor]# | Create a proctor object to manage the specified `originalAllocator`. Unless the `release` method of this proctor is invoked, the `release` method of `originalAllocator` is automatically invoked upon destruction of this proctor. | xref:BloombergLP/bdlma/AutoReleaser/2destructor.adoc[`~AutoReleaser`] [.small]#[destructor]# | Destroy this proctor object and, unless the `release` method has been invoked on this object with no subsequent call to `reset`, invoke the `release` method of the held allocator or pool. | xref:BloombergLP/bdlma/AutoReleaser/release.adoc[`release`] | Release from management the allocator or pool currently managed by this proctor. If no allocator or pool is currently being managed, this method has no effect. | xref:BloombergLP/bdlma/AutoReleaser/reset.adoc[`reset`] | Set the specified `newAllocator` as the allocator or pool to be managed by this proctor. Note that this method releases from management any previously held allocator or pool, and so may be invoked with or without having called `release` when reusing this object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#