diff options
| author | Niraj Modi | 2019-07-08 06:30:32 +0000 |
|---|---|---|
| committer | Niraj Modi | 2019-07-08 10:19:10 +0000 |
| commit | de243af25cf849e9e332d82f0dc5e4b655e99107 (patch) | |
| tree | dbfe6f0ce620c40a115504cae054c4cdc95c2920 | |
| parent | 7f7a19b29360638b7d3a872a7fc5dddb58544665 (diff) | |
| download | eclipse.platform.swt-de243af25cf849e9e332d82f0dc5e4b655e99107.tar.gz eclipse.platform.swt-de243af25cf849e9e332d82f0dc5e4b655e99107.tar.xz eclipse.platform.swt-de243af25cf849e9e332d82f0dc5e4b655e99107.zip | |
Bug 127975 (Part2) - Exception thrown when disposing caret
Change-Id: If99ad981ca50290493551db9de604aa6dc1d02cb
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java | 7 | ||||
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java index 69011e8234..4ce9537975 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -286,7 +286,10 @@ void killFocus () { @Override void releaseParent () { super.releaseParent (); - if (this == parent.getCaret ()) parent.setCaret (null); + if (parent != null && this == parent.caret) { + if (!parent.isDisposed()) parent.setCaret (null); + else parent.caret = null; + } } @Override diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java index b71f625078..53773e7da7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -324,7 +324,10 @@ void killFocus () { @Override void releaseParent () { super.releaseParent (); - if (this == parent.getCaret ()) parent.setCaret (null); + if (parent != null && this == parent.caret) { + if (!parent.isDisposed()) parent.setCaret (null); + else parent.caret = null; + } } @Override |
