comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: memory leaks with xloadct?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: memory leaks with xloadct? [message #33553 is a reply to message #33480] Wed, 08 January 2003 15:06 Go to previous message
robert.dimeo is currently offline  robert.dimeo
Messages: 42
Registered: November 2001
Member
David, thanks for the response. This is exactly what I needed!

David Fanning <david@dfanning.com> wrote in message news:<MPG.1886302a1f6b8dbc989a9a@news.frii.com>...

> The problem is that XLOADCT cleans up after itself if
> you hit the DONE button, but not otherwise. This is
> *exactly* why widget programs need CLEANUP routines that
> get called when programs die! :-)
>
> This problem is even more pernicious, since the pointer
> that needs to get cleaned up is in a Common block, so you
> can't even free it up with HEAP_GC!
>
> Here is a cleanup routine for XLOADCT:
>
> ;*********************************************************
> PRO xloadct_cleanup, id
> COMMON colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
> COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt,
> $
> top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $
> gamma, color, use_values, ncolors, cbot, siz, w_height, show_win, $
> updt_callback, p_updt_cb_data
> if PTR_VALID(p_updt_cb_data) then PTR_FREE, p_updt_cb_data
> END
> ;*********************************************************
>
>
> Assign it like this:
>
> XManager, "xloadct", base, NO_BLOCK=(NOT(FLOAT(block))), $
> Cleanup='xloadct_cleanup'
>
>
> That should do it. :-)
>
> Cheers,
>
> David
[Message index]
 
Read Message
Read Message
Previous Topic: map_set coastline data
Next Topic: MRI, ROI and displaying as a meshed object

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 17:06:30 PDT 2025

Total time taken to generate the page: 1.67831 seconds