Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-11-17 15:04:28 +0000
committerDarin Wright2006-11-17 15:04:28 +0000
commite13a68f4aa32ee9541e32a0450c6c71477626af8 (patch)
treed7b11ac4eec195f91880718b55a2aed8f75da6d4
parentfb33957877206e2c1b18ac1c0eb8a187e89b0891 (diff)
downloadeclipse.platform.debug-e13a68f4aa32ee9541e32a0450c6c71477626af8.tar.gz
eclipse.platform.debug-e13a68f4aa32ee9541e32a0450c6c71477626af8.tar.xz
eclipse.platform.debug-e13a68f4aa32ee9541e32a0450c6c71477626af8.zip
Bug 164953 Watch expression keeps reference to old IDebugTarget object after debug session terminates
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
index d146514c1..9e3638ec7 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
@@ -25,16 +25,13 @@ import org.eclipse.debug.core.model.IWatchExpressionResult;
/**
* Base watch expression implementation.
- * <p>
- * Clients may extend this class.
- * </p>
+ *
* @since 3.0
*/
public class WatchExpression implements IWatchExpression {
protected String fExpressionText;
protected IWatchExpressionResult fResult;
- protected IDebugTarget fDebugTarget;
protected IDebugElement fCurrentContext;
private boolean fEnabled= true;
private boolean fPending= false;
@@ -64,11 +61,10 @@ public class WatchExpression implements IWatchExpression {
* @see org.eclipse.debug.core.model.IWatchExpression#evaluate()
*/
public void evaluate() {
- if (fCurrentContext == null) {
+ IDebugElement context= fCurrentContext;
+ if (context == null) {
return;
}
- IDebugElement context= fCurrentContext;
- fDebugTarget= context.getDebugTarget();
IWatchExpressionListener listener= new IWatchExpressionListener() {
/* (non-Javadoc)
@@ -170,7 +166,11 @@ public class WatchExpression implements IWatchExpression {
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
public IDebugTarget getDebugTarget() {
- return fDebugTarget;
+ IDebugElement element = fCurrentContext;
+ if (element != null) {
+ return element.getDebugTarget();
+ }
+ return null;
}
/**

Back to the top