Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2019-12-16 10:14:14 +0000
committerAndrey Loskutov2019-12-16 19:18:34 +0000
commit466d3c597673095877146de0471f3dc0f6297b2e (patch)
tree0b18182e05dc6c66ac61a5a977f784827530700d
parent9d6e19785b417802f4cf1e21fe6cc92f739d6773 (diff)
downloadeclipse.platform.swt-466d3c597673095877146de0471f3dc0f6297b2e.tar.gz
eclipse.platform.swt-466d3c597673095877146de0471f3dc0f6297b2e.tar.xz
eclipse.platform.swt-466d3c597673095877146de0471f3dc0f6297b2e.zip
Bug 558355 - [gtk] Possible leak in Accessible.release()
We iterate over children list and dispose them, but children remove itself on disposal from the list, so the next widget in the list will be not disposed. Change-Id: I265002015551f95fa23ff589987f3314761b4669 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
index 078404b5d1..4188173386 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
@@ -553,8 +553,9 @@ public class Accessible {
void release () {
if (children != null) {
- for (int i = 0; i < children.size(); i++) {
- Accessible child = children.get(i);
+ List<Accessible> temp = new ArrayList<>(children);
+ for (int i = 0; i < temp.size(); i++) {
+ Accessible child = temp.get(i);
child.dispose();
}
}

Back to the top