|
From: Keith D. (JIRA) <no...@at...> - 2007-08-10 14:21:27
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keith Donald updated RCP-97:
----------------------------
Assignee: (was: Keith Donald)
> Creating ActionCommands without a CommandFaceDescriptor causes memory leaks
> ---------------------------------------------------------------------------
>
> Key: RCP-97
> URL: http://opensource.atlassian.com/projects/spring/browse/RCP-97
> Project: Spring Framework Rich Client Project
> Issue Type: Improvement
> Reporter: Calvin Yu
> Attachments: CommandFaceButtonManager.patch
>
>
> If no CommandFaceDescriptor is specified, then CommandFaceDescriptor.BLANK_FACE_DESCRIPTOR. The ActionCommand's CommandFaceButtonManager then calls addPropertyChangeListener() on this descriptor, adding itself as the listener. Unless another CommandFaceDescriptor is set for that ActionCommand, the CommandFaceButtonManager will never be removed from BLANK_FACE_DESCRIPTOR, and therefore the manager and command will never be garbage collected since the descriptor is a static.
> Possible solutions:
> 1) Remove AbstractPropertyChangePublisher's final modifiers on the addPropertyChangeListener() methods, so that they can be overriden by BLANK_FACE_DESCRIPTOR to be a no-op.
> 2) Create a new blank CommandFaceDescriptor instead of using a constant.
> 3) Modify CommandFaceButtonManager so that it isn't added as a PropertyChangeListener if the descriptor is BLANK_FACE_DESCRIPTOR.
> I've attached a patch to solution #3. While I believe #3 isn't the most optimal solution, it does have less potential side effects to solutions #1 and #2.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|