Chromium Code Reviews| Index: runtime/vm/isolate_reload.cc |
| diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc |
| index 0957f6fa388e471ee16abfaef84d7da022d02434..81ba9a8009611d4f026b6d8673d657b4457171aa 100644 |
| --- a/runtime/vm/isolate_reload.cc |
| +++ b/runtime/vm/isolate_reload.cc |
| @@ -924,9 +924,13 @@ void IsolateReloadContext::RollbackClasses() { |
| class_table->SetAt(i, saved_class_table_[i]); |
| } |
| } |
| - free(saved_class_table_); |
| + |
| + RawClass** local_saved_class_table = saved_class_table_; |
| saved_class_table_ = NULL; |
| - saved_num_cids_ = 0; |
| + // Can't free this table immediately as another thread (e.g., the sweeper) may |
| + // be suspended between loading the table pointer and loading the table |
| + // element. Table will be freed at the next major GC or isolate shutdown. |
| + class_table->AddOldTable(local_saved_class_table); |
|
siva
2016/08/12 21:10:45
When does saved_num_cids_ get set to 0?
rmacnak
2016/08/12 21:15:29
Never. We can't set it to zero here because anothe
|
| } |