Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2014-06-09 19:28:13 +0000
committerGenevieve Bastien2014-06-10 13:56:53 +0000
commit083e873d03eab859860502ff3b4a638240850249 (patch)
tree28c9fc5ef7007f9c0762836e118341e255372fdc
parent1b3ccef1dabb7360d891f0460bb1f8a981aefca8 (diff)
downloadorg.eclipse.linuxtools-083e873d03eab859860502ff3b4a638240850249.tar.gz
org.eclipse.linuxtools-083e873d03eab859860502ff3b4a638240850249.tar.xz
org.eclipse.linuxtools-083e873d03eab859860502ff3b4a638240850249.zip
TMF: Fix resource leak when trace indexer is re-created
That happens when a trace was created with the default constructor, a default indexer is set and when the trace is initialized, a new indexer is created again, but the previous one is not disposed and the file remains opened. Change-Id: I1cb163130563419c81833fd9d383a3eeb2a4f9ee Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/28221 Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
index e220ccf66f..057cc22881 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
@@ -249,6 +249,9 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
super.init(traceName, type);
// register as VIP after super.init() because TmfComponent registers to signal manager there
TmfSignalManager.registerVIP(this);
+ if (fIndexer != null) {
+ fIndexer.dispose();
+ }
fIndexer = createIndexer(fCacheSize);
}

Back to the top