Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoic Prieur-Drevon2018-03-01 15:26:16 +0000
committerLoic Prieur-Drevon2018-03-07 15:11:58 +0000
commit82bb1fcdbc32753dea31f223ca4a6f67562d02b0 (patch)
tree3ff10d7c894b0055eeec0c408777d81ec6b139c7
parent94e881f915ebf11e6f747ed74b6222386f12bc68 (diff)
downloadorg.eclipse.tracecompass-82bb1fcdbc32753dea31f223ca4a6f67562d02b0.tar.gz
org.eclipse.tracecompass-82bb1fcdbc32753dea31f223ca4a6f67562d02b0.tar.xz
org.eclipse.tracecompass-82bb1fcdbc32753dea31f223ca4a6f67562d02b0.zip
tmf.ui: Remove functions from CallStackView when trace is closed.
Bug 531861 - [TMF] Call Stack view leaks function map entries Function names were cached to display in the tree viewer, but not removed when traces are deleted. Change-Id: I5f293ccb8eae5231fad4f6876d5387339e69afe6 Signed-off-by: Loic Prieur-Drevon <loic.prieurdrevon@gmail.com> Reviewed-on: https://git.eclipse.org/r/118432 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Reviewed-on: https://git.eclipse.org/r/118811 Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java
index 4d114f11a0..ddb4ddcbd8 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java
@@ -55,6 +55,7 @@ import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
import org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderManager;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
@@ -364,6 +365,10 @@ public class CallStackView extends AbstractTimeGraphView {
@Override
public void mouseDoubleClick(MouseEvent event) {
ITimeGraphEntry selection = getTimeGraphViewer().getSelection();
+ if (!(selection instanceof TimeGraphEntry)) {
+ // also null checks
+ return;
+ }
ITimeGraphState function = fFunctions.get(((TimeGraphEntry) selection).getModel().getId());
if (function != null) {
long entryTime = function.getStartTime();
@@ -925,4 +930,18 @@ public class CallStackView extends AbstractTimeGraphView {
getConfigureSymbolsAction().setEnabled(providerPages.length > 0);
}
+ @TmfSignalHandler
+ @Override
+ public void traceClosed(TmfTraceClosedSignal signal) {
+ List<@NonNull TimeGraphEntry> traceEntries = getEntryList(signal.getTrace());
+ if (traceEntries != null) {
+ /*
+ * remove functions associated to the trace's entries.
+ */
+ Iterable<TimeGraphEntry> all = Iterables.concat(Iterables.transform(traceEntries, Utils::flatten));
+ all.forEach(entry -> fFunctions.remove(entry.getModel().getId()));
+ }
+ super.traceClosed(signal);
+ }
+
}

Back to the top