chsvlib
chsv helper source code

◆ release()

handle_type release ( )

Releases ownership of the stored handle, if any, by returning its value and replacing it with a value-initialized handle, i.e. handle_type().

Returns
A handle of the resource managed by the AutoResource before the call.
Remarks
If the AutoResource owned a valid handle before the call (i.e. a handle for which the checker returns true) the method returns it in a valid state without closing. Otherwise the function returns an invalid handle that causes the checker to return false. Also the function replaces the stored handle by a value-initialized handle_type() which is considered as invalid handle which cannot be closed. Therefore the checker must always return false if applied over the default value-initialized handle.