Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370976 - Browser#execute never returns if widget is never displayed
Summary: Browser#execute never returns if widget is never displayed
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 11:41 EST by Graham Mising name CLA
Modified: 2012-02-09 10:43 EST (History)
1 user (show)

See Also:


Attachments
Patch to break out of loop (1.06 KB, patch)
2012-02-08 11:46 EST, Graham Mising name CLA
no flags Details | Diff
Corrected patch (1.06 KB, patch)
2012-02-08 12:13 EST, Graham Mising name CLA
no flags Details | Diff
Another solution (1.98 KB, patch)
2012-02-09 04:11 EST, Ivan Furnadjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Mising name CLA 2012-02-08 11:41:16 EST
Build Identifier: CVS HEAD

Browser#execute can be run before a widget is displayed and will continue the display's readAndDispatch until it receives a result.  If the widget is disposed, no result will ever be received and this function never returns.

Reproducible: Always

Steps to Reproduce:
1. Create a Browser widget.
2. Call execute such as browser.execute("window.scrollTo(0, document.body.scrollHeight)");
3. Dispose the widget before it is displayed
4. Note that the execute never returns.
Comment 1 Graham Mising name CLA 2012-02-08 11:46:24 EST
Created attachment 210741 [details]
Patch to break out of loop
Comment 2 Graham Mising name CLA 2012-02-08 11:47:21 EST
I posted a patch which seems to work in breaking out of the loop.  Another possibility to to call SWT.error(SWT.ERROR_WIDGET_DISPOSED) instead of returning false.
Comment 3 Graham Mising name CLA 2012-02-08 12:13:18 EST
Created attachment 210744 [details]
Corrected patch

In creating the previous patch, the isDisposed check was put in the wrong place.
Comment 4 Ivan Furnadjiev CLA 2012-02-09 04:11:02 EST
Created attachment 210782 [details]
Another solution

In this patch a disposed listener is added to the browser that cleans its internal state ( set executeResult to false ). Graham, could you give this patch a try?
Comment 5 Graham Mising name CLA 2012-02-09 10:14:06 EST
Ivan's patch also resolves the issue.
Comment 6 Ivan Furnadjiev CLA 2012-02-09 10:43:21 EST
Applied second patch to CVS HEAD. JUnit test added.