Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.4, 1.5
-
Fix Version/s: 1.5
-
Component/s: Taverna Core
-
Labels:None
Description
After making a XScuflView, it will reference the ScuflModel. It will also register itself as a listener in the model. The list of listeners is kept alive by the NotifyThread, and thereby the XScuflView, and thereby the ScuflModel, making the ScuflModel never run out of references.
The quick "fix" to this is to always do model.removeListener(scuflView) when you are finished with the XScuflView. So all code that creates a XScuflView will have to be checked.
This is of course not a good or clever fix.
This also highlights that the XScuflView is usually just created to extract an XML version of the model. Maybe this could be made a utility method so "normal users" don't have to worry about such destruction.
However, this also shows that any listener could have references to the ScuflModel, and so killing the NotifyThread only in the destructor is probably not a good solution. Some destroy() method of ScuflModel would probably be needed. After all, I think there are less ScuflModel's constructed than XScuflViews.
Committed fixes. Now users will have to do model.removeListener(xScuflView) or they can use one of the two new static methods of XScuflView instead of creating their own instance.