[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
Fri Dec 16 12:19:09 EST 2011


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

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

Method dispose() is not called recursively, that is true.
Here is its implementation:
{code}
public void dispose () {
	/*
	* Note:  It is valid to attempt to dispose a widget
	* more than once.  If this happens, fail silently.
	*/
	if (isDisposed ()) return;
	if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
	release (true);
}
{code}
It invokes method release(true). Method release(boolean) is called recursively. That means, that if dispose() is invoked on a root composite of the dialog, release(true) will be invoked for each widget in the tree, and DisposeEvent will be sent to each widget. Also, please note that Widget.release(boolean) is package local and not documented, it is not a part of API and may be subjected to changes without notice.
                
> 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