setLastTrace(other.fLastTraceRead);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.core.trace.TmfContext#dispose()
+ */
+ @Override
+ public void dispose() {
+ for (ITmfContext context : fContexts) {
+ context.dispose();
+ }
+ super.dispose();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.linuxtools.tmf.core.trace.TmfContext#clone()
*/
*/
private IFile fBookmarksFile;
-
- // Saved experiment context (optimization)
- private TmfExperimentContext fExperimentContext;
-
// ------------------------------------------------------------------------
// Construction
// ------------------------------------------------------------------------
public ITmfTimestamp getTimestamp(final int index) {
final ITmfContext context = seekEvent(index);
final ITmfEvent event = getNext(context);
+ context.dispose();
return (event != null) ? event.getTimestamp() : null;
}
}
- // Check if we are already at the right index
- if ((fExperimentContext != null) && fExperimentContext.getRank() == request.getIndex()) {
- return fExperimentContext;
- }
-
return seekEvent(request.getIndex());
}
context.setLastTrace(TmfExperimentContext.NO_TRACE);
context.setRank((location == null) ? 0 : ITmfContext.UNKNOWN_RANK);
- fExperimentContext = context;
return context;
}
location.getLocation().getLocations()[trace] = traceContext.getLocation().clone();
}
- fExperimentContext = expContext.clone();
processEvent(event);
}
}
if (getStreamingInterval() == 0) {
final ITmfContext context = seekEvent(0);
final ITmfEvent event = getNext(context);
+ context.dispose();
if (event == null) {
return;
}
final ITmfContext nextEventContext = context.clone(); // Must use clone() to get the right subtype...
ITmfEvent event = getNext(nextEventContext);
while (event != null && event.getTimestamp().compareTo(timestamp, false) < 0) {
+ context.dispose();
context = nextEventContext.clone();
event = getNext(nextEventContext);
}
+ nextEventContext.dispose();
if (event == null) {
context.setLocation(null);
context.setRank(ITmfContext.UNKNOWN_RANK);
/*******************************************************************************
* Copyright (c) 2010 Ericsson
- *
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Patrick Tasse - Initial API and implementation
*******************************************************************************/
@Override
public synchronized CustomTxtEvent getNext(final ITmfContext context) {
- final ITmfContext savedContext = context.clone();
+ final ITmfContext savedContext = new TmfContext(context.getLocation(), context.getRank());
final CustomTxtEvent event = parse(context);
if (event != null) {
updateAttributes(savedContext, event.getTimestamp());
/*******************************************************************************
* Copyright (c) 2010 Ericsson
- *
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Patrick Tasse - Initial API and implementation
*******************************************************************************/
@Override
public synchronized CustomXmlEvent getNext(final ITmfContext context) {
- final ITmfContext savedContext = context.clone();
+ final ITmfContext savedContext = new TmfContext(context.getLocation(), context.getRank());
final CustomXmlEvent event = parse(context);
if (event != null) {
updateAttributes(savedContext, event.getTimestamp());
// Get the rank of the selected event in the table
final ITmfContext context = fTrace.seekEvent(timestamp);
final long rank = context.getRank();
+ context.dispose();
fSelectedRank = rank;
fTable.getDisplay().asyncExec(new Runnable() {