Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315060 - 'Widget is disposed'-Exception when using DefaultButtons
Summary: 'Widget is disposed'-Exception when using DefaultButtons
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 1.3 RC3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-31 07:22 EDT by Stefan Hansel CLA
Modified: 2010-06-01 04:07 EDT (History)
1 user (show)

See Also:


Attachments
Code to reproduce the error (1.95 KB, application/octet-stream)
2010-05-31 07:22 EDT, Stefan Hansel CLA
no flags Details
Stacktrace (2.44 KB, text/plain)
2010-05-31 07:23 EDT, Stefan Hansel CLA
no flags Details
Proposed Fix (1.77 KB, patch)
2010-05-31 11:51 EDT, Ralf Sternberg CLA
ruediger.herrmann: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Hansel CLA 2010-05-31 07:22:14 EDT
Created attachment 170512 [details]
Code to reproduce the error

We have a problem with RAP 1.3M3 (also still reproducable with RAP1.3RC2).
The problem described here doesn't exist in RAP 1.2.1 and currently prevents upgrading to the latest RAP version.

We have an UI containing a DefaultButton. Later on this UI (including the Button) gets disposed and replaced by a new UI. 
TextLCAUtil then runs into a "Widget is disposed"-Exception for that Button.

Attached you will find the Stacktrace along with a small sample where you should easily be able to reproduce the problem.
The Exception only comes, when the new UI contains a TextField.
Comment 1 Stefan Hansel CLA 2010-05-31 07:23:09 EDT
Created attachment 170513 [details]
Stacktrace
Comment 2 Ralf Sternberg CLA 2010-05-31 11:51:11 EDT
Created attachment 170544 [details]
Proposed Fix

The problem is that Shell#getDefaultButton() returns a disposed Button instance. This is not the case in SWT. This patch changes this method to return null if the registered default button has been disposed.
Comment 3 Ralf Sternberg CLA 2010-06-01 04:07:12 EDT
Committed the patch to CVS HEAD.