diff options
author | Darin Wright | 2006-05-17 15:30:30 +0000 |
---|---|---|
committer | Darin Wright | 2006-05-17 15:30:30 +0000 |
commit | 6d74aac9dce548b167915cc684b49117349c9d4f (patch) | |
tree | f2a01070538208b35032a641dbb7fb4290491507 /org.eclipse.debug.ui | |
parent | 34172c694d8224cdd964c7baba2e5f4035a6a211 (diff) | |
download | eclipse.platform.debug-6d74aac9dce548b167915cc684b49117349c9d4f.tar.gz eclipse.platform.debug-6d74aac9dce548b167915cc684b49117349c9d4f.tar.xz eclipse.platform.debug-6d74aac9dce548b167915cc684b49117349c9d4f.zip |
Bug 141908 - Memory Leak in debugger
Diffstat (limited to 'org.eclipse.debug.ui')
2 files changed, 22 insertions, 15 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java index 7e5f9ec94..0acee0d9b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java @@ -50,7 +50,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplayAdapter { switch (event.getKind()) { case DebugEvent.TERMINATE: clearCachedModel(event.getSource()); - // fall thru + // fall through case DebugEvent.RESUME: if (!event.isEvaluation()) { clearSourceSelection(event.getSource()); @@ -96,16 +96,19 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplayAdapter { IStackFrame lookupFrame = fTarget; ISourceLocator lookupLocator = fLocator; - ISourceLookupResult result = null; - result = DebugUITools.lookupSource(lookupFrame, lookupLocator); - synchronized (StackFrameSourceDisplayAdapter.this) { - fPrevResult = (SourceLookupResult)result; - fPrevFrame = lookupFrame; - } - if (!monitor.isCanceled()) { - fSourceDisplayJob.setDisplayInfo(result, fPage); - fSourceDisplayJob.schedule(); + if (lookupFrame != null && lookupLocator != null) { + ISourceLookupResult result = null; + result = DebugUITools.lookupSource(lookupFrame, lookupLocator); + synchronized (StackFrameSourceDisplayAdapter.this) { + fPrevResult = (SourceLookupResult)result; + fPrevFrame = lookupFrame; + } + if (!monitor.isCanceled() && fPage != null) { + fSourceDisplayJob.setDisplayInfo(result, fPage); + fSourceDisplayJob.schedule(); + } } + setLookupInfo(null, null, null); } return Status.OK_STATUS; } @@ -136,9 +139,10 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplayAdapter { * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) */ public synchronized IStatus runInUIThread(IProgressMonitor monitor) { - if (!monitor.isCanceled()) { + if (!monitor.isCanceled() && fResult != null && fPage != null) { DebugUITools.displaySource(fResult, fPage); } + setDisplayInfo(null, null); return Status.OK_STATUS; } @@ -161,7 +165,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplayAdapter { } /** - * Deselects any source decorations associated with the given thread or + * Clears any source decorations associated with the given thread or * debug target. * * @param source thread or debug target diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java index 54e17b926..0a4b7828c 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java @@ -109,10 +109,10 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis private ISelection fCurrentSelection; /** - * Array used to store indicies of the path to an item in the viewer being mapped - * by a 'set data' callback. Indicies are bottom up. For example when 'set data' for + * Array used to store indices of the path to an item in the viewer being mapped + * by a 'set data' callback. Indices are bottom up. For example when 'set data' for * the 3rd child of the 4th child of the 2nd root element were being asked for, - * the first 3 indicies would look like: [3, 4, 2, ....]. We re-use an array to avoid + * the first 3 indices would look like: [3, 4, 2, ....]. We re-use an array to avoid * creating a new one all the time. The array grows as needed to accommodate deep * elements. */ @@ -248,6 +248,8 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis * @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object, java.lang.Object) */ protected synchronized void inputChanged(Object input, Object oldInput) { + fPendingSelection = null; + fCurrentSelection = null; if (fUpdatePolicy == null) { fUpdatePolicy = createUpdatePolicy(); fUpdatePolicy.init(this); @@ -262,6 +264,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis getControl().setData(fModel.getRootNode().getElement()); } else { unmapAllElements(); + getControl().setData(null); } refresh(); } |