From e3f80d9cdae460b94533a0ab7c736f32f112a418 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 12 Aug 2016 20:38:01 -0700 Subject: [PATCH] Fix startup crash --- engine/src/flutter/runtime/sky_view.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/runtime/sky_view.cc b/engine/src/flutter/runtime/sky_view.cc index dadc3366e0..4f96b824ca 100644 --- a/engine/src/flutter/runtime/sky_view.cc +++ b/engine/src/flutter/runtime/sky_view.cc @@ -55,11 +55,11 @@ void SkyView::CreateView(const std::string& script_uri) { dart_controller_.reset(new DartController()); std::unique_ptr window(new Window(this)); - std::unique_ptr dart_state( - new UIDartState(this, std::move(window))); - dart_controller_->CreateIsolateFor(script_uri, std::move(dart_state)); + dart_controller_->CreateIsolateFor(script_uri, std::unique_ptr( + new UIDartState(this, std::move(window)))); - DartState::Scope scope(dart_state.get()); + UIDartState* dart_state = dart_controller_->dart_state(); + DartState::Scope scope(dart_state); dart_state->window()->DidCreateIsolate(); client_->DidCreateMainIsolate(dart_state->isolate());