Univeristy of Alabama in Huntsville

UAH LTG IDL Library

IDL Routines from Phillip Bitzer and UAH Lightning Group

summary     class     fields     routine details     file attributes

misc/

pmb_clean_pointers.pro

Misc, GUI

includes main-level program

This routine takes a structure that contains pointers and releases those pointers from the heap. Very simple procedure for quickly releasing a number of pointers from memory. Nothing is output except a clean heap :-) Turns out, this routine is quite handy when exiting a GUI, which may have many pointers in the "info" structure

Examples

Consider the following snippet:

s = {a:PTR_NEW(10), b:PTR_NEW('hello')} help, /heap pmb_clean_pointers, s help, /heap
The first help, /heap should yield two pointers, while the second should yield no pointers in memory.

This will work on an array of structures with pointers too:

s = [{a:PTR_NEW(10), b:PTR_NEW('hello')}, {a:PTR_NEW(11), b:PTR_NEW('world')}] help, /heap pmb_clean_pointers, s help, /heap

Author information

Author

Phillip M. Bitzer, University of Alabama in Huntsville, pm.bitzer "AT" uah.edu

History

Modification History:

First written from legacy code: Jul 25, 2012 Cleaned documentation 20121016 PMB Slight change to match change in pmb_get_armor_data 20121209 PMB

Routines

top pmb_clean_pointers

pmb_clean_pointers, struct

Free any pointers in a structure

Parameters

struct in required type=structure

A structure containing pointers

Other attributes

Uses:

None

File attributes

Modification date: Tue Mar 25 17:15:54 2014
Lines: 11
Docformat: rst rst