* the trace to register.
*/
public static synchronized void removeTrace(final CtfTmfTrace trace) {
- map.remove(trace);
+ CtfTraceManager mgr = map.remove(trace);
+ if (mgr != null) {
+ mgr.clear();
+ }
}
/**
/*
* if we're not full yet, just add an element.
*/
- retVal = new CtfIterator(fTrace);
+ retVal = fTrace.createIterator();
addElement(context, retVal);
} else {
*/
retVal = replaceRandomElement(context);
}
- final CtfLocationData location = (CtfLocationData) context.getLocation().getLocationData();
- retVal.seek( location);
+ if (context.getLocation() != null) {
+ final CtfLocationData location = (CtfLocationData) context.getLocation().getLocationInfo();
+ retVal.seek(location);
+ }
}
return retVal;
}
return elem;
}
+ void clear() {
+ for (CtfIterator iterator : fMap.values()) {
+ iterator.dispose();
+ }
+ fMap.clear();
+ fRandomAccess.clear();
+ }
}