diff options
author | Veronika Irvine <veronika> | 2005-05-20 14:29:38 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2005-05-20 14:29:38 +0000 |
commit | 31812241e88b430c97326c9c7a804878842f3cd3 (patch) | |
tree | 4a014975ee5991f650c28cbd3832c71863e76241 | |
parent | 984497f475fba0cc44c5a72b95a614f5d148ea45 (diff) | |
download | eclipse.platform.swt-31812241e88b430c97326c9c7a804878842f3cd3.tar.gz eclipse.platform.swt-31812241e88b430c97326c9c7a804878842f3cd3.tar.xz eclipse.platform.swt-31812241e88b430c97326c9c7a804878842f3cd3.zip |
Bug 95691 After bringToTop widget could be disposed
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java | 1 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java index 3257fa3fcc..5eff77559f 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java @@ -290,6 +290,7 @@ LRESULT WM_LBUTTONDOWN (int wParam, int lParam) { lastX = event.x; lastY = event.y; menuShell ().bringToTop (); + if (isDisposed ()) return LRESULT.ZERO; if (OS.IsWinCE) { OS.UpdateWindow (hwndTrack); } else { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java index 1e3956f9f9..4461649e12 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java @@ -812,6 +812,7 @@ int hwndMDIClient () { public void open () { checkWidget (); bringToTop (); + if (isDisposed ()) return; /* * Feature on WinCE PPC. A new application becomes * the foreground application only if it has at least @@ -957,6 +958,7 @@ public void setActive () { checkWidget (); if(!isVisible()) return; bringToTop (); + // widget could be disposed at this point } void setActiveControl (Control control) { @@ -1265,7 +1267,10 @@ public void setVisible (boolean visible) { if (visible) { display.setModalShell (this); Control control = display._getFocusControl (); - if (control != null && !control.isActive ()) bringToTop (); + if (control != null && !control.isActive ()) { + bringToTop (); + if (isDisposed ()) return; + } int hwndShell = OS.GetActiveWindow (); if (hwndShell == 0) { if (parent != null) hwndShell = parent.handle; |