Index: runtime/vm/timeline.cc |
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc |
index a1fefeb8a68c61e1b534f4633a5c6eae0d737158..a4988525cc51854231f1fc2e0a9b298d9cb073b9 100644 |
--- a/runtime/vm/timeline.cc |
+++ b/runtime/vm/timeline.cc |
@@ -646,6 +646,20 @@ void TimelineEventEndlessRecorder::PrintJSONEvents(JSONArray* events) const { |
} |
+void TimelineEventEndlessRecorder::Clear() { |
+ TimelineEventBlock* current = head_; |
+ while (current != NULL) { |
+ TimelineEventBlock* next = current->next(); |
+ delete current; |
+ current = next; |
+ } |
+ head_ = NULL; |
+ block_index_ = 0; |
+ Thread* thread = Thread::Current(); |
+ thread->set_timeline_block(NULL); |
+} |
+ |
+ |
TimelineEventBlock::TimelineEventBlock(intptr_t block_index) |
: next_(NULL), |
length_(0), |