Re-enable Dart_TimelineGetMicros on init on macOS (flutter/engine#4712)

Previously, a call to Dart_TimelineGetMicros() before a call to
Dart_Initialize() resulted in a crash. This was fixed in
dart-lang/sdk@7434bcad57.

Related:
* flutter/flutter#4006: SkyShell.app on Mac crashes on startup
* dart-lang/sdk#26486:  [dart_tools_api.h] Dart_TimelineGetMicros crashes on Mac if called before Dart_Initialize
This commit is contained in:
Chris Bracken
2018-02-24 10:21:40 -08:00
committed by GitHub
parent 37a0e71c71
commit a5e4e34bbc

View File

@@ -34,11 +34,7 @@ class EmbedderState {
EmbedderState(std::string icu_data_path,
std::string application_library_path,
std::string bundle_path) {
#if TARGET_OS_IPHONE
// This calls crashes on MacOS because we haven't run Dart_Initialize yet.
// See https://github.com/flutter/flutter/issues/4006
blink::engine_main_enter_ts = Dart_TimelineGetMicros();
#endif
FXL_DCHECK([NSThread isMainThread])
<< "Embedder initialization must occur on the main platform thread";