[jbosstools-issues] [JBoss JIRA] (JBIDE-10247) org.jboss.tools.jst.css: org.jboss.tools.jst.css.dialog.selector.CSSSelectorPartComposite has 4 Image leaks

Viacheslav Kabanovich (Commented) (JIRA) jira-events at lists.jboss.org
Thu Dec 15 12:44:10 EST 2011


    [ https://issues.jboss.org/browse/JBIDE-10247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651371#comment-12651371 ] 

Viacheslav Kabanovich commented on JBIDE-10247:
-----------------------------------------------

Class Button does not override methods Widget.dispose() and Control.setEnabled().

Comments to method Control.setEnabled() say nothing to the effect that client must explicitly invoke dispose() on an object, on which setEnabled() was invoked.
Comments to method Widget.dispose() say that it "Disposes of the operating system resources associated with the receiver and _all its descendants_". 

When dialog is closed, the tree of its controls is disposed and that is why we receive the dispose event. Button overrides package local methods releaseHandle() and releaseWidget(), which are invoked for each widget in the tree, and they should release all internally created resources.

If a leak tracking tool detects a leak in resources internally created by Button, it is Eclipse's bug and should be reported to Eclipse. I shudder at the idea of invoking dispose() explicitly on each widget.
                
> org.jboss.tools.jst.css: org.jboss.tools.jst.css.dialog.selector.CSSSelectorPartComposite has 4 Image leaks
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-10247
>                 URL: https://issues.jboss.org/browse/JBIDE-10247
>             Project: Tools (JBoss Tools)
>          Issue Type: Sub-task
>          Components: common/jst/core
>    Affects Versions: 3.3.0.M4
>            Reporter: Vitali Yemialyanchyk
>            Assignee: Viacheslav Kabanovich
>             Fix For: 3.3.0.Beta1
>
>
> try to test with "Sleak" tool - should get at least 4 images leak:
> line 357: rightButton.setEnabled(false);
> line 371: leftButton.setEnabled(false);
> line 384: upButton.setEnabled(false);
> line 397: downButton.setEnabled(false);
> - these lines responsible for image leaks. To avoid leaks you should call dispose directly in proper place:
> rightButton.dispose();
> leftButton.dispose();
> upButton.dispose();
> downButton.dispose();

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list