commit | 631d51aa69013b49cc537c25eef14e741cd30973 | [log] [tgz] |
---|---|---|
author | Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> | Tue Oct 13 09:26:20 2020 +0200 |
committer | Andrey Loskutov <loskutov@gmx.de> | Mon Nov 23 04:27:10 2020 -0500 |
tree | 1d77e011aaec2a0cd968af5c3350225d157608e1 | |
parent | aff50918b0e8c5cc3a8266e59d0b880f57296704 [diff] |
Bug 567826 - [GTK] JVM crash on Display.dispose() due to Clipboard If 'SWT.Dispose' handler is a bit slow, user might be able to switch to other application and Ctrl+C there. When this happens, Linux calls 'ClipboardProxy.clearFunc()' with the following stack: Native: clipboard_unset() at gtk/gtkclipboard.c:782 Native: selection_clear_event_cb() at gtk/gtkclipboard.c:424 Native: <emit signal for 'GDK_SELECTION_CLEAR'> Native: gtk_widget_event_internal() at gtk/gtkwidget.c:7808 Native: gtk_main_do_event() at gtk/gtkmain.c:1860 Java: org.eclipse.swt.internal.gtk.GTK._gtk_main_do_event() Java: org.eclipse.swt.widgets.Display.eventProc() Java: org.eclipse.swt.internal.gtk.OS._g_main_context_iteration() Java: org.eclipse.swt.widgets.Display.readAndDispatch() Java: org.eclipse.swt.widgets.Display.release() If 'Callback' for 'clearFunc' is already disposed, JVM crashes. The solution is to dispose callback after 'Display.readAndDispatch()' in 'Display.release()'. This patch has a curious side effect: if 'SWT.Dispose' handler is slow, Shell is now visible (and eventually shows "not responding") for its duration. I understand that this is because 'gtk_clipboard_store()' also does some unexpected event processing. I consider this side effect as not a regression because the same behavior is seen when clipboard is not owned by SWT by the time of 'Display.dispose()'. Change-Id: I2cc11600f06030243e55d70f24b881dcb9b67503 Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.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!