HeapFreeIndir Function (ROM Call 0x98)

alloc.h

void HeapFreeIndir (HANDLE *HandlePtr);

Frees a heap block given a pointer to it.

HeapFreeIndir is like HeapFree except you pass the address of a variable which keeps the block handle instead of the handle itself. If the handle that HandlePtr points to is not H_NULL, then it frees that handle and sets the handle variable that is pointed to by HandlePtr to H_NULL.

Maybe this sounds a bit confusing to you. In fact, doing

HeapFreeIndir (&handle);    // The ampersand ('&') is important
works exactly the same as
if (handle) HeapFree (handle);
handle = H_NULL;
Note: In releases of TIGCCLIB prior to 2.2, the information about this routine was quite misleading or even wrong.


Uses: HeapFree
Used by: cmd_blddata, cmd_cubicreg, cmd_custom, cmd_dialog, cmd_disphome, cmd_expreg, cmd_linreg, cmd_lnreg, cmd_logistic, cmd_medmed, cmd_newdata, cmd_onevar, cmd_pause, cmd_popup, cmd_powerreg, cmd_quadreg, cmd_quartreg, cmd_request, cmd_sinreg, cmd_sorta, cmd_sortd, cmd_stogdb, cmd_toolbar, cmd_twovar, DlgMessage, ERD_dialog, EV_clearPasteString, EV_defaultHandler, handleRclKey, MO_modeDialog, GR3_paint3d, gdb_recall, HomeExecute, HomePushEStack, HS_freeFIFONode, TE_close, cleanup_de_mem, cleanup_seq_mem, CustomFree, EV_quit, gr_delete_fldpic, GR3_addContours, GR3_freeDB, GT_Trace, Regraph, SetGraphMode, SP_Define, VarStoreLink, ROM Call 0x3F7, ROM Call 0x3F8, ROM Call 0x424, ROM Call 0x438, ROM Call 0x45B, ROM Call 0x486, ROM Call 0x494, ROM Call 0x495