commit | aec661287354ebd74f607d83b584b162c8047520 | [log] [tgz] |
---|---|---|
author | Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> | Mon Jun 21 22:39:52 2021 +0200 |
committer | Niraj Modi <niraj.modi@in.ibm.com> | Tue Jun 29 11:15:20 2021 -0400 |
tree | 9f70e89251de582db2ea224777f98f385531cde2 | |
parent | 95c13ae734af87c9f90cac265904356cb4255e66 [diff] |
Bug 562233 - Insulating SWT from exceptions in dispose listeners The problem was that throwing exceptions from dispose handlers skipped most of dispose code in SWT, which caused various problems like 1) SWT believed that Widget is alive while OS believed that it's dead 2) Resources were disposed but Widgets continued to live 3) Shells vanished but SWT still thought that it's not disposed, causing exit conditions in loop to continue. 4) etc etc etc This patch insulates SWT from exceptions in user's listeners on key dispose paths. If an exception occurs, it's stashed away to be re-thrown after SWT does the essential work. If there are multiple concurrent exceptions, these are added to 'Throwable.addSuppressed()'. This patch only insulates some paths while others (such as various 'Widget.disposeChildren()') remain for future patches. It is unfortunate how code becomes polluted with try/catch blocks. I considered implementing 'ExceptionStash.do(Runnable)' to hide the boilerplate code, but that would mean throwing 2 more lines on callstacks on many paths. I decided that it's not worth it. Change-Id: Ia85ddca98e2a50a89e2c5cab47c9b3936f0a8a42 Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/182320 Tested-by: Platform Bot <platform-bot@eclipse.org> Tested-by: Niraj Modi <niraj.modi@in.ibm.com> Reviewed-by: Niraj Modi <niraj.modi@in.ibm.com>
Thanks for your interest in this project.
See the following description for how to contribute a feature or a bug fix to SWT.
Information regarding source code management, builds, coding standards, and more and be found under the following link.
Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).
Contact the project developers via the project's “dev” list.
This project uses Bugzilla to track ongoing development and issues.
Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!