The PTR_FREE procedure destroys the heap variables pointed at by its pointer arguments. Any memory used by the heap variable is released, and the variable ceases to exist. No change is made to the arguments themselves and all pointers to the destroyed variables continue to exist. Such pointers are known as dangling references. PTR_FREE is the only way that pointer heap variables can be destroyed. If PTR_FREE is not called on a heap variable, it continues to exist until the IDL session ends, even if no pointers remain that can be used to reference it.
pointer1will not destroy the heap variable pointed at by
pointer2. Take care not to lose the only pointer to a heap variable by destroying a pointer to a heap variable that contains that pointer.
PTR_FREE, P1, ... ..., Pn
Scalar or array arguments of pointer type. If the NULL pointer is passed, PTR_FREE ignores it quietly.