Fix leak
Make thread local static to avoid keep alive the GanttDiagramGraph from the thread local set in the thread. FEA: ItEr74S08DeployFramework
This commit is contained in:
parent
e17ac70699
commit
7a909fcfea
1 changed files with 5 additions and 3 deletions
|
|
@ -27,12 +27,14 @@ import org.apache.commons.lang.Validate;
|
|||
*/
|
||||
public abstract class PreAndPostNotReentrantActionsWrapper {
|
||||
|
||||
private final ThreadLocal<Boolean> inside = new ThreadLocal<Boolean>() {
|
||||
private static final class BooleanThreadLocal extends ThreadLocal<Boolean> {
|
||||
@Override
|
||||
protected Boolean initialValue() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private final ThreadLocal<Boolean> inside = new BooleanThreadLocal();
|
||||
|
||||
public void doAction(IAction action) {
|
||||
Validate.notNull(action);
|
||||
|
|
@ -49,7 +51,7 @@ public abstract class PreAndPostNotReentrantActionsWrapper {
|
|||
try {
|
||||
action.doAction();
|
||||
} finally {
|
||||
inside.set(false);
|
||||
inside.remove();
|
||||
postAction();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue