File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -2017,13 +2017,8 @@ TimelineEventFileRecorderBase::~TimelineEventFileRecorderBase() {
2017
2017
OSThread::Join (thread_id_);
2018
2018
thread_id_ = OSThread::kInvalidThreadJoinId ;
2019
2019
2020
- TimelineEvent* event = head_;
2021
- while (event != nullptr ) {
2022
- TimelineEvent* next = event->next ();
2023
- delete event;
2024
- event = next;
2025
- }
2026
- head_ = tail_ = nullptr ;
2020
+ ASSERT (head_ == nullptr );
2021
+ ASSERT (tail_ == nullptr );
2027
2022
2028
2023
Dart_FileCloseCallback file_close = Dart::file_close_callback ();
2029
2024
(*file_close)(file_);
@@ -2033,10 +2028,13 @@ TimelineEventFileRecorderBase::~TimelineEventFileRecorderBase() {
2033
2028
void TimelineEventFileRecorderBase::Drain () {
2034
2029
MonitorLocker ml (&monitor_);
2035
2030
thread_id_ = OSThread::GetCurrentThreadJoinId (OSThread::Current ());
2036
- while (!shutting_down_ ) {
2031
+ for (;; ) {
2037
2032
if (head_ == nullptr ) {
2033
+ if (shutting_down_) {
2034
+ break ;
2035
+ }
2038
2036
ml.Wait ();
2039
- continue ; // Recheck empty and shutting down .
2037
+ continue ; // Recheck empty.
2040
2038
}
2041
2039
TimelineEvent* event = head_;
2042
2040
TimelineEvent* next = event->next ();
You can’t perform that action at this time.
0 commit comments