Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2010-10-20 16:08:34 +0000
committerFelipe Heidrich2010-10-20 16:08:34 +0000
commit6d126efbe84583f1585e51841901a3cc0f9332d4 (patch)
tree6abc0ecab09eb7f36b20f002202ee6d9992c6535 /bundles
parent728dfe361f9b89fb75e8a21e595eea556ba23912 (diff)
downloadeclipse.platform.swt-6d126efbe84583f1585e51841901a3cc0f9332d4.tar.gz
eclipse.platform.swt-6d126efbe84583f1585e51841901a3cc0f9332d4.tar.xz
eclipse.platform.swt-6d126efbe84583f1585e51841901a3cc0f9332d4.zip
Bug 328173 - core dump in OS._GTK_WIDGET_UNSET_FLAGS
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java2
3 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index a69add36cc..9aa6d4ba9f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -163,6 +163,8 @@ void fixFocus (Control focusControl) {
int /*long*/ focusHandle = shell.vboxHandle;
OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
OS.gtk_widget_grab_focus (focusHandle);
+ // widget could be disposed at this point
+ if (isDisposed ()) return;
OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
}
@@ -2168,6 +2170,8 @@ boolean forceFocus (int /*long*/ focusHandle) {
/* When the control is zero sized it must be realized */
OS.gtk_widget_realize (focusHandle);
OS.gtk_widget_grab_focus (focusHandle);
+ // widget could be disposed at this point
+ if (isDisposed ()) return false;
Shell shell = getShell ();
int /*long*/ shellHandle = shell.shellHandle;
int /*long*/ handle = OS.gtk_window_get_focus (shellHandle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
index e141b605cb..34e6e2fca2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
@@ -513,6 +513,8 @@ boolean setFocus () {
if (!OS.gtk_widget_get_child_visible (handle)) return false;
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
OS.gtk_widget_grab_focus (handle);
+ // widget could be disposed at this point
+ if (isDisposed ()) return false;
boolean result = OS.gtk_widget_is_focus (handle);
if (!result) OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
return result;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 4c5c7d95e6..03ea1c8ba9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -880,6 +880,8 @@ boolean setFocus () {
if (!OS.gtk_widget_get_child_visible (handle)) return false;
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
OS.gtk_widget_grab_focus (handle);
+ // widget could be disposed at this point
+ if (isDisposed ()) return false;
boolean result = OS.gtk_widget_is_focus (handle);
if (!result) OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
return result;

Back to the top