Freeing gadgets

BlitzMax Forums/BlitzMax Beginners Area/Freeing gadgets

Gavin Beard(Posted 2006) [#1]
My current project has a large amount of gadgets, its wrapped in a Type, when the main window is closed i just call END and the program finishes. is there a better way to do it to make sure all gadgets are freed or this this automatics?

thanks


LosButcher(Posted 2006) [#2]
END should be sufficient. No need to free them manually.


Diablo(Posted 2006) [#3]
thier is a free method

tgadget.free()


Dreamora(Posted 2006) [#4]
oder freegadget(gadget:tgadget)


Chris C(Posted 2006) [#5]
from the docs

Function FreeGadget( gadget:TGadget )
Description Remove gadget and free it's resources.


this can also be used to remove a second window thats been used as a dialog, this will (should!) free all the child gadgets providing they arent being referenced by anything else


Dreamora(Posted 2006) [#6]
Yeah normally. But there are cases where it results in MAVs.

For example: Try to assign a gadget to a treeview or similar ... At least TextFields (wanted to do a "In Gadget" modification of the name) leads to a crash if you free the treeview before the gadget


Gavin Beard(Posted 2006) [#7]
k so if i free all windows before end just to be sure?