Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Matveev2019-03-21 18:33:08 +0000
committerEric Williams2019-03-22 16:43:02 +0000
commit011cb819833c603b54292ceea9bddfdba726a456 (patch)
treee49994f45ed136cd6a661dc7d8980d2d43d9d172
parent93f6c162a5d2e9f2f7f23c5493e7cad8ad9329d3 (diff)
downloadeclipse.platform.swt-011cb819833c603b54292ceea9bddfdba726a456.tar.gz
eclipse.platform.swt-011cb819833c603b54292ceea9bddfdba726a456.tar.xz
eclipse.platform.swt-011cb819833c603b54292ceea9bddfdba726a456.zip
Bug 545268 - Recreating TabItem crashes jvm
Restore parent for control associated with tab item See https://bugs.eclipse.org/bugs/attachment.cgi?id=277820 Change-Id: I8c77475ab07ee42b6c1dc0db4b4347530a2c450c Signed-off-by: Pavel Matveev <pmatveev42@gmail.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
index c7c3bd0caf..30bcca126e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
@@ -259,7 +259,7 @@ void release (boolean destroy) {
//Since controls are now nested under the tabItem,
//tabItem is responsible for it's release.
if (control != null && !control.isDisposed ()) {
- control.release (destroy);
+ Control.gtk_widget_reparent (control, parent.parentingHandle());
}
super.release (destroy);
}
@@ -337,8 +337,12 @@ public void setControl (Control control) {
newControl.setVisible (true);
}
- if (oldControl != null && newControl != null && oldControl != newControl)
- oldControl.setVisible (false);
+ if ((oldControl != null) && (oldControl != newControl)) {
+ Control.gtk_widget_reparent (oldControl, parent.parentingHandle());
+ if (newControl != null) {
+ oldControl.setVisible (false);
+ }
+ }
}
void setFontDescription (long /*int*/ font) {

Back to the top