Index: vm/dart_api_impl.cc |
=================================================================== |
--- vm/dart_api_impl.cc (revision 2724) |
+++ vm/dart_api_impl.cc (working copy) |
@@ -53,9 +53,12 @@ |
// Return error if isolate is in an inconsistent state. |
// Return NULL when no error condition exists. |
const char* CheckIsolateState(Isolate* isolate, bool generating_snapshot) { |
- bool success = (generating_snapshot) ? |
- ClassFinalizer::FinalizePendingClassesForSnapshotCreation() : |
- ClassFinalizer::FinalizePendingClasses(); |
+ bool success = true; |
+ if (!ClassFinalizer::AllClassesFinalized()) { |
+ success = (generating_snapshot) ? |
+ ClassFinalizer::FinalizePendingClassesForSnapshotCreation() : |
+ ClassFinalizer::FinalizePendingClasses(); |
+ } |
if (success && !generating_snapshot) { |
success = isolate->object_store()->PreallocateObjects(); |
} |