ctf: Fix leaking context in CtfTmfTrace.initTrace()
authorPatrick Tasse <patrick.tasse@gmail.com>
Thu, 6 Aug 2015 14:30:25 +0000 (10:30 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Mon, 10 Aug 2015 20:28:11 +0000 (16:28 -0400)
The context used to read the first event of the trace is never disposed.
Its trace reader is auto-closed after registering the event types.

This leaves the context with its closed trace reader in the iterator
manager. If the iterator manager becomes full, the trace reader can be
reused for another context but this will fail since it's been closed.

Change-Id: Iab224db1349d2ded5cb0f2d69b7b418a53e5eca0
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/53332
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java

index 05fc3fc22e22581eaa75fa54eb9e67f88d49374a..786efe899b1e7ce4526ad8e276d8c82c7c053c70 100644 (file)
@@ -194,6 +194,7 @@ public class CtfTmfTrace extends TmfTrace
                     }
                 }
             }
+            ctx.dispose();
         } catch (final CTFException e) {
             /*
              * If it failed at the init(), we can assume it's because the file
This page took 0.025967 seconds and 5 git commands to generate.