I recently updated my gadgets to this style
LAYOUT_AddChild, Objects[GAD_DETAILS1]=IIntuition->NewObject(ButtonClass,NULL, ..... TAG_DONE),
instead of
LAYOUT_AddChild, Objects[GAD_DETAILS1]=IIntuition->NewObject(NULL,"button.gadget", ..... TAG_DONE),
The window opens just fine the first time.
When I close the window (all objects freed) and reopen it, when creating the gadgets it now crashes at any gadget that has a list attached to it: Choosers, ClickTab, ListBrowser.
It is like the gadget class is freeing my list so when I remake the gadget the list is invalid so it crashes. If I comment out the line for the list, it does not crash.
So, is the gadget class now freeing my lists? It didn't before. I don't want it to. The lists are static.
Do you remove everything from the lists before closing?
Since a listbrowser list has to be removed before any changes are made, it's not much of a stretch to think that you might want to remove your list elements before freeing the window (and it's contents)
LyleHaze
Classes won't touch the list during dispose. Lists can easily be reused. Some classes even support sharing of lists.