diff options
3 files changed, 10 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index c5dfb0ae93..1290655aef 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -1057,9 +1057,10 @@ long eventWindow () { // Find the internal GDK_INPUT_ONLY window long children = GDK.gdk_window_get_children (window); if (children != 0) { + long childrenIterator = children; do { - window = OS.g_list_data (children); - } while ((children = OS.g_list_next (children)) != 0); + window = OS.g_list_data (childrenIterator); + } while ((childrenIterator = OS.g_list_next (childrenIterator)) != 0); } OS.g_list_free (children); 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 171106a002..3afd040cd7 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 @@ -3004,9 +3004,10 @@ void showWidget () { } } else { long list = GTK3.gtk_container_get_children (shellHandle); - while (list != 0) { - GTK3.gtk_container_remove (shellHandle, OS.g_list_data (list)); - list = OS.g_list_next(list); + long listIterator = list; + while (listIterator != 0) { + GTK3.gtk_container_remove (shellHandle, OS.g_list_data (listIterator)); + listIterator = OS.g_list_next(listIterator); } OS.g_list_free (list); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index d4a7f0d862..9df332a540 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -829,6 +829,7 @@ long eventWindow () { long window = super.paintWindow (); long children = GDK.gdk_window_get_children (window); if (children != 0) { + long childrenIterator = children; /* * When search or cancel icons are added to Text, those * icon window(s) are added to the beginning of the list. @@ -836,8 +837,8 @@ long eventWindow () { * browse to the end of the list. */ do { - window = OS.g_list_data (children); - } while ((children = OS.g_list_next (children)) != 0); + window = OS.g_list_data (childrenIterator); + } while ((childrenIterator = OS.g_list_next (childrenIterator)) != 0); } OS.g_list_free (children); return window; |