Freeing gadgets
BlitzMax Forums/BlitzMax Beginners Area/Freeing gadgets| 
 | ||
| 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 | 
| 
 | ||
| END should be sufficient. No need to free them manually. | 
| 
 | ||
| thier is a free method tgadget.free() | 
| 
 | ||
| oder freegadget(gadget:tgadget) | 
| 
 | ||
| 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 | 
| 
 | ||
| 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 | 
| 
 | ||
| k so if i free all  windows before end just to be sure? |