[#BloombergLP-bslma-DestructorProctor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::DestructorProctor
:relfileprefix: ../../
:mrdocs:

This class implements a proctor that, unless its `release` method has previously been invoked, automatically destroys a managed object upon destruction by invoking the (managed) object&apos;s destructor&period;

== Synopsis

Declared in `&lt;bslma&lowbar;destructorproctor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class DestructorProctor;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/DestructorProctor/2constructor.adoc[`DestructorProctor`]         [.small]#[constructor]#
| Create a destructor proctor that conditionally manages the specified `object` (if non&hyphen;zero) by invoking the destructor of the object managed by this proctor (if not released &hyphen;&hyphen; see `release`) upon destruction&period;
| xref:BloombergLP/bslma/DestructorProctor/2destructor.adoc[`&#126;DestructorProctor`] [.small]#[destructor]#
| Destroy this destructor proctor, and destroy the object it manages (if any) by invoking the destructor of the (managed) object&period; If no object is currently being managed, this method has no effect&period;
| xref:BloombergLP/bslma/DestructorProctor/release.adoc[`release`] 
| Release from management the object currently managed by this proctor&period; If no object is currently being managed, this method has no effect&period;
| xref:BloombergLP/bslma/DestructorProctor/reset.adoc[`reset`] 
| Set the specified `object` as the object to be managed by this proctor&period; The behavior is undefined unless `object` is non&hyphen;zero&period; Note that this method releases any previously&hyphen;managed object from management (without destroying it), and so may be invoked with or without having called `release` when reusing this object&period;
|===



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