;Super-free. Performs a recursive free on anything passed in. ;1. If it is a pointer or array of pointers, str_free is called on *s. ; The pointer is then freed ;2. If it is a structure or array of structures, str_free is called on ; each field of each element of the structure ;3. If it is an object, call obj_destroy. The object needs to have a ; cleanup method to free its own pointers. pro str_free,s case size(s,/type) of 8: begin ;Structure for i=0LL,n_elements(s)-1 do begin for j=0,n_tags(s[i])-1 do begin str_free,s[i].(j) end end end 10: begin ;Pointer for i=0LL,n_elements(s)-1 do begin if ptr_valid(s[i]) then begin str_free,*(s[i]) end end ptr_free,s end 11: begin ;Object reference obj_destroy,s end else: begin ;Don't have to do anything return end end end