in 3d slicer ScriptedLoadableModuleWidget class, setup is to load the widget,when exitting from slicer,what method will be called to prevent memory leak
When you call a “factory” mehtod that returns a new vtkCollection
object then you need to call UnRegister(None)
on that object to prevent memory leaks. See more information here.
Thanks a lot for the help.