Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 414849

Summary: Widget disposed exception after disposing an image used by ToolItem
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Rüdiger Herrmann CLA 2013-08-12 05:03:09 EDT
The following code leads to a widget disposed exception in RAP:
  Image image = ... // obtain image from somewhere
  toolItem.setImage( image );
  toolItem.getImage().dispose();
  toolItem.setText( "some text" );

The same code works in SWT on Windows, even the image is shown after being disposed (which seems a bit strange to me).
I thought we had a similar issue with another widget, but I can't remember what we decided and couldn't find a bug either.
Comment 1 Ivan Furnadjiev CLA 2013-08-12 05:17:58 EDT
This (or similar) issue has been discussed in couple of bugs (see bug 342943 and bug 321135). The topic has been discussed with SWT team as well ( bug 342943). Disposing a resource which is still in use in any widget is illegal in SWT (even it's working "somehow" under some platforms). That's why I think that the bug is invalid.
Comment 2 Rüdiger Herrmann CLA 2013-08-12 05:58:56 EDT
(In reply to comment #1)
> This (or similar) issue has been discussed in couple of bugs (see bug 342943
> and bug 321135). The topic has been discussed with SWT team as well ( bug
> 342943). Disposing a resource which is still in use in any widget is illegal
> in SWT (even it's working "somehow" under some platforms). That's why I
> think that the bug is invalid.

Thanks Ivan for the pointers - that's what I was looking for!