IUnknown::Release method

Decrements the reference count for an interface on an object.

Syntax

ULONG Release(

);

Parameters

This method has no parameters.

Return Value

The method returns the new reference count. This value is intended to be used only for test purposes.

Remarks

When the reference count on an object reaches zero, Release must cause the interface pointer to free itself. When the released pointer is the only existing reference to an object (whether the object supports single or multiple interfaces), the implementation must free the object.

Note that aggregation of objects restricts the ability to recover interface pointers.

Notes to Callers

Call this method when you no longer need to use an interface pointer. If you are writing a method that takes an in-out parameter, call Release on the pointer you are passing in before copying the out-value on top of it.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header unknwn.h (include Unknwn.h)

See Also

IUnknown