HeapDestroy Function
The HeapDestroy function destroys the specified heap object.
BOOL HeapDestroy(HANDLE hHeap);
Parameters
| Parameter | Description |
|---|---|
hHeap |
A handle to the heap object to be destroyed. This handle is returned by the HeapCreate function. |
Return Value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To get extended error information, call GetLastError.
Remarks
The HeapDestroy function destroys the specified heap object created by a call to the HeapCreate function. After the heap is destroyed, the handle to the heap is no longer valid and cannot be used for memory allocation or deallocation.
It is important to destroy heaps when they are no longer needed to free up system resources.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows XP |
| Minimum supported server | Windows Server 2003 |
| Header | heapapi.h |
| Library | kernel32.lib |
| DLL | Kernel32.dll |