Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2014-11-21 11:06:00 +0000
committerMarvin Mueller2014-11-21 11:12:04 +0000
commitc59f3fa744dd10ed56efa4e6faeb86997119dac4 (patch)
treec94929a36bc8f94216583db82a48d6167d96b650 /org.eclipse.jubula.rc.swt
parent0f8a8bb727ddbc5a3fd5f03ab3cbed05dab25cb6 (diff)
downloadorg.eclipse.jubula.core-c59f3fa744dd10ed56efa4e6faeb86997119dac4.tar.gz
org.eclipse.jubula.core-c59f3fa744dd10ed56efa4e6faeb86997119dac4.tar.xz
org.eclipse.jubula.core-c59f3fa744dd10ed56efa4e6faeb86997119dac4.zip
Non-sprint task - possible fix for memory leak in swt
Components which are disposed or hidden where not deleted in any case from our internal maps, which sometimes can lead to a memory leak when the components itself have references to data.
Diffstat (limited to 'org.eclipse.jubula.rc.swt')
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java25
1 files changed, 7 insertions, 18 deletions
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java
index 1024db77c..e7828619e 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java
@@ -577,24 +577,13 @@ public class SwtAUTHierarchy extends AUTHierarchy {
}
// remove the child from hash table
- final Object childToRemove = getRealMap().get(toRemove);
- SwtHierarchyContainer hierarchyChild = null;
- if (childToRemove != null) {
- hierarchyChild = (SwtHierarchyContainer)getHierarchyMap()
- .remove(childToRemove);
- }
- // update the hierarchy
- if (hierarchyChild != null) {
- SwtHierarchyContainer hierarchyParent = hierarchyChild
- .getParent();
- if (hierarchyParent != null) {
- hierarchyParent.remove(hierarchyChild);
- } else {
- // child was not in the hierarchy
- // -> log this is an error
- log.error("hierarchy structure corrupted, child has no parent: " //$NON-NLS-1$
- + hierarchyChild);
- }
+ final Object componentToRemove = getRealMap().get(toRemove);
+ if (componentToRemove != null) {
+ SwtHierarchyContainer hierarchyContainer =
+ (SwtHierarchyContainer) getHierarchyMap()
+ .remove(componentToRemove);
+ // update the hierarchy and deletes the container and component from maps
+ removeFromHierarchy(hierarchyContainer);
} else {
// child was not in the hierarchy map
// -> log this

Back to the top