| Summary: | Exception thrown when disposing caret | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Florian Priester <fwp> | ||||
| Component: | SWT | Assignee: | Niraj Modi <niraj.modi> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | niraj.modi, remy.suen | ||||
| Version: | 3.2 | Keywords: | triaged | ||||
| Target Milestone: | 4.13 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| See Also: |
https://git.eclipse.org/r/145585 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=68da4318d8869a0a7957ca4663aefb7954a6a578 https://git.eclipse.org/r/145591 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=de243af25cf849e9e332d82f0dc5e4b655e99107 |
||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Confirmed to be broken with I20090811-0800 on Linux/gtk+. Exception in thread "main" org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:3887) at org.eclipse.swt.SWT.error(SWT.java:3802) at org.eclipse.swt.SWT.error(SWT.java:3773) at org.eclipse.swt.widgets.Widget.error(Widget.java:452) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:390) at org.eclipse.swt.widgets.Canvas.getCaret(Canvas.java:124) at org.eclipse.swt.widgets.Caret.releaseParent(Caret.java:296) at org.eclipse.swt.widgets.Widget.release(Widget.java:1062) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:448) at Main.main(Main.java:217) This is still a problem - we should be handling the caret disposal better. As a workaround, you can add a dispose listener and handle the caret disposal there. (In reply to Bogdan Gheorghe from comment #2) > This is still a problem - we should be handling the caret disposal better. > As a workaround, you can add a dispose listener and handle the caret > disposal there. Tested on Win7, can reproduce the problem with snippet in comment 0, will investigate. I have a possible solution for this bug fix, targeting for 4.13 New Gerrit change created: https://git.eclipse.org/r/145585 Gerrit change https://git.eclipse.org/r/145585 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=68da4318d8869a0a7957ca4663aefb7954a6a578 Created attachment 279188 [details]
TestSnippet.
Tested with attached snippet on my Ubuntu setup and can reproduce the problem on GTK as well. Since the Carent.releaseParent() logic is same on all platform, so IMO this problem must also be seen on Cocoa.
New Gerrit change created: https://git.eclipse.org/r/145591 Gerrit change https://git.eclipse.org/r/145591 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=de243af25cf849e9e332d82f0dc5e4b655e99107 Resolving now. Verified using Build id: I20190708-1800 on Win7. |
SWT-win32, v3224 When running the code below, the following exception is thrown: Exception in thread "main" org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:3349) at org.eclipse.swt.SWT.error(SWT.java:3272) at org.eclipse.swt.SWT.error(SWT.java:3243) at org.eclipse.swt.widgets.Widget.error(Widget.java:432) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:327) at org.eclipse.swt.widgets.Canvas.getCaret(Canvas.java:108) at org.eclipse.swt.widgets.Caret.releaseParent(Caret.java:283) at org.eclipse.swt.widgets.Widget.release(Widget.java:748) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:412) at CaretDisposeTest.main(CaretDisposeTest.java:...) --- import org.eclipse.swt.*; import org.eclipse.swt.widgets.*; public class CaretDisposeTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); Caret caret = new Caret(shell, SWT.NONE); shell.setCaret(null); shell.dispose(); caret.dispose(); display.dispose(); } }