diff options
author | Felipe Heidrich <fheidric> | 2003-07-17 19:16:37 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2003-07-17 19:16:37 +0000 |
commit | b793a454a5222757c1ab07d7ee6fab3591e468b1 (patch) | |
tree | 61f8e91c52dafdf0627749c9e2189689557d3af8 | |
parent | e9b58467f4f8ec7c407846ff3b5168a584c074ad (diff) | |
download | eclipse.platform.swt-b793a454a5222757c1ab07d7ee6fab3591e468b1.tar.gz eclipse.platform.swt-b793a454a5222757c1ab07d7ee6fab3591e468b1.tar.xz eclipse.platform.swt-b793a454a5222757c1ab07d7ee6fab3591e468b1.zip |
39965 & 40329 (menu problem)
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 5 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java | 10 |
2 files changed, 12 insertions, 3 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 f9ca3e6e09..f315a68d2c 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 @@ -2073,10 +2073,13 @@ void releaseWidget () { OS.gtk_im_context_reset (imHandle); OS.gtk_im_context_set_client_window (imHandle, 0); } + if (menu != null && !menu.isDisposed ()) { + menu.dispose (); + } + menu = null; cursor = null; toolTipText = null; parent = null; - menu = null; layoutData = null; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 1316cb1a34..3a33394338 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -945,8 +945,14 @@ public void setVisible (boolean visible) { OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME); } sendEvent (SWT.Show); - // NOT DONE - gtk_widget_show_now dispatches events. - OS.gtk_widget_show_now (shellHandle); + // widget could be disposed at this point + if (isDisposed ()) return; + OS.gtk_widget_show (shellHandle); + while (!isDisposed () && !OS.GTK_WIDGET_MAPPED (shellHandle)) { + OS.gtk_main_iteration (); + } + // widget could be disposed at this point + if (isDisposed ()) return; adjustTrim (); } else { OS.gtk_widget_hide (shellHandle); |