[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Aug 9 13:15:08 1994 
Subject:Re: Popmemlim and garbage collection 
From:"A.Sloman" 
Volume-ID:940810.02 

> 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.

The windows will not be cleared by the garbage collector if they are
still pointed to by variables or if they are stored in a list pointed to
by a variable, etc. (See HELP SYSGARBAGE and TEACH GC for information
about garbage collections.)

So if you don't want to have a separate variable for each window, make
sure that you add the current value of rc_window to some global list
before you create a new window.

This would suffice
	global vars windowlist = [];

Then before creating each new window:

	[^rc_window ^^windowlist] -> windowlist;

If you later wish to get rid of all windows, do
	false -> rc_graphic;
	[] -> windowlist;
	sysgarbage();

or
	applist( windowlist, XptDestroyWindow );

Aaron