Commit b59982ec authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Properly await future when starting app in daemon mode (#8227)

Fixes #8209
parent 90574b04
......@@ -310,7 +310,7 @@ class AppDomain extends Domain {
BuildMode buildMode = getBuildModeForName(mode) ?? BuildMode.debug;
AppInstance app = startApp(
AppInstance app = await startApp(
device, projectDirectory, target, route,
buildMode, startPaused, enableHotReload);
......@@ -322,14 +322,14 @@ class AppDomain extends Domain {
};
}
AppInstance startApp(
Future<AppInstance> startApp(
Device device, String projectDirectory, String target, String route,
BuildMode buildMode, bool startPaused, bool enableHotReload, {
String applicationBinary,
String projectRootPath,
String packagesFilePath,
String projectAssets,
}) {
}) async {
DebuggingOptions options;
switch (buildMode) {
......@@ -401,7 +401,7 @@ class AppDomain extends Domain {
_sendAppEvent(app, 'started');
});
app._runInZone(this, () async {
await app._runInZone(this, () async {
try {
await runner.run(
connectionInfoCompleter: connectionInfoCompleter,
......
......@@ -213,7 +213,7 @@ class RunCommand extends RunCommandBase {
notifyingLogger: new NotifyingLogger(), logToStdout: true);
AppInstance app;
try {
app = daemon.appDomain.startApp(
app = await daemon.appDomain.startApp(
device, fs.currentDirectory.path, targetFile, route,
getBuildMode(), argResults['start-paused'], hotMode,
applicationBinary: argResults['use-application-binary'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment