ICallFrame::Free method (callobj.h)

Frees the frame copy to avoid a memory leak.

When a copy of a call frame is made with the Copy method, the call frame does not clean up the copied data automatically. Therefore, after a copy of the call frame is returned, the user is responsible for calling the Free method to free the frame copy and avoid a memory leak.

Syntax

HRESULT Free(
  [in] ICallFrame       *pframeArgsDest,
  [in] ICallFrameWalker *pWalkerDestFree,
  [in] ICallFrameWalker *pWalkerCopy,
  [in] DWORD            freeFlags,
  [in] ICallFrameWalker *pWalkerFree,
  [in] DWORD            nullFlags
);

Parameters

[in] pframeArgsDest

A pointer to an instance of the ICallFrame interface. Represents the stack pointer of the call frame to which the out parameters should be copied before the frame copy is freed. The destination frame is usually the parent frame from which the frame was originally copied. This parameter is optional.

When freeing a frame and specifying a pframeArgsDest parameter which is in the same memory space as that of the receiver frame, then only the pWalkerCopy parameter is called on each interface pointer.

[in] pWalkerDestFree

A pointer to an instance of the ICallFrameWalker interface. If there exist in and out parameters in pframeArgsDest, then the propagation requires that those values be freed. By providing the pWalkerDestFree object, interface pointers will be freed. If pframeArgsDest is NULL, then this parameter must also be NULL and the interface pointers should be released by calling the Release method.

[in] pWalkerCopy

A pointer to an instance of the ICallFrameWalker interface. When the in and out parameters in pframeArgsDest are freed, then the propagation of out parameters is carried out. If this parameter is not specified, then the interface pointers will be passed to AddRef. This parameter is optional.

[in] freeFlags

Flags from the CALLFRAME_FREE enumeration.

[in] pWalkerFree

A pointer to an instance of the ICallFrameWalker interface. When specified, a callback is made for each interface pointer encountered while freeing occurs. If this parameter is not specified, then the interface pointers are freed by the Release method.

[in] nullFlags

Flags from the CALLFRAME_NULL enumeration.

Return value

This method can return the following values.

Return code Description
S_OK
The method completed successfully.
E_UNEXPECTED
An unexpected error has occurred.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header callobj.h

See also

ICallFrame