Freeing an IconStrip

BlitzMax Forums/BlitzMax GUI Programming/Freeing an IconStrip

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Are iconstrips being properly released from listbox (and potentially other) gadgets?

The following code produces interesting results on both Leopard (1.28) and XP (1.26)

Via process memory watch, XP process memory hits a ceiling of about 141 Mb - whereas Leopard didn't have a ceiling although I did stop watching at around 300Mb. I don't know about you, but 141 Mb seems like a pretty late kick in for the GC.

Or perhaps there's a "ReleaseIconStrip" function that I'm overlooking?

Can others verify this behaviour?

Strict

Global panel:TGadget
Global listbox:TGadget
Global window:TGadget

window=CreateWindow("Leak tester", 40,40,800,800,,WINDOW_RESIZABLE|WINDOW_TITLEBAR|WINDOW_STATUS)

Local i:Int
	
Repeat
	
	Panel = CreatePanel(0,0,600,600,window)

	'	Listbox
	listbox = CreateListBox(0,0,100,100,Panel)
	Local icon_strip:TIconStrip = LoadIconStrip(BlitzMaxpath()+"/src/maxide/icons.PNG")
	
	SetGadgetIconStrip(listbox, icon_strip)

	For  i = 0 Until 100
	
		AddGadgetItem listbox,"item " +i,GADGETITEM_NORMAL,i Mod 5
	
	Next

	FreeGadget listbox
	listbox = Null
	icon_strip.pixmap = Null
	icon_strip = Null
	FreeGadget Panel
	
	 PollEvent()
	If CurrentEvent And CurrentEvent.id = EVENT_WINDOWCLOSE Then End
	
	SetStatusText window, "GC says... " +GCMemAlloced()
	
Forever


Thanks

-David