> I now have a problem whereby I do are fair amount of processing on an
> image, but if I have several xgraphic windows up - using rc_array - and
> the heap store gets used up during processing and a garbage collection
> is done to free some memeory up. The trouble is this clears all my
> xgraphic windows. I have altered the value of popmemlim several times,
> but no matter how large I set it to, this problem reoccurs.
If you create your own windows and then put images in them with
-rc_array-, then what happens to the windows at garbage collection is up
to your part of the code. -rc_array- just draws in the window much as,
say, -rc_draw- does, and using it will not affect what the garbage
collector does. You'll find that any window without a pointer to it
suffers the same fate, not just those where you've used rc_array.
As Aaron said, the thing to do is to keep pointers to your windows. If
you use -rci_show- to create windows, this is done automatically and
they are protected against garbage collection until you either destroy
them by clicking on them or by calling -rci_show_destroy-. As an
alternative to what Aaron proposed, you could adapt the code in LIB
RCI_SHOW to do your window management, or even simpler just make all
your windows with -rci_show-. (If you give -rci_show- a list instead of
an array as an argument it will give you a blank Xgraphic window which
you can assign to -rc_window-, and take it from there. See the TEACH and
HELP files for details of setting up coordinate systems simply.)
David Young
|