Commit 2cf50ce5 authored by John McCutchan's avatar John McCutchan Committed by GitHub

Fix hot restart when application is being debugged (#9450)

- [x] Resume the isolate before performing a hot restart.

Fixes #8923
parent 4906297c
......@@ -329,6 +329,18 @@ class HotRunner extends ResidentRunner {
final bool updatedDevFS = await _updateDevFS();
if (!updatedDevFS)
return new OperationResult(1, 'DevFS Synchronization Failed');
// Check if the isolate is paused and resume it.
if (currentView?.uiIsolate != null) {
// Reload the isolate.
await currentView.uiIsolate.reload();
final ServiceEvent pauseEvent = currentView.uiIsolate.pauseEvent;
if ((pauseEvent != null) && pauseEvent.isPauseEvent) {
// Resume the isolate so that it can be killed by the embedder.
await currentView.uiIsolate.resume();
}
}
// We are now running from source.
_runningFromSnapshot = false;
await _launchFromDevFS(package, mainPath);
restartTimer.stop();
printTrace('Restart performed in '
......
......@@ -941,6 +941,12 @@ class Isolate extends ServiceObjectOwner {
}
}
/// Resumes the isolate.
Future<Map<String, dynamic>> resume() {
return invokeRpcRaw('resume');
}
// Flutter extension methods.
// Invoke a flutter extension method, if the flutter extension is not
......
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