mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix hot restart when application is being debugged (#9450)
- [x] Resume the isolate before performing a hot restart. Fixes #8923
This commit is contained in:
parent
4906297c28
commit
2cf50ce574
@ -329,6 +329,18 @@ class HotRunner extends ResidentRunner {
|
|||||||
final bool updatedDevFS = await _updateDevFS();
|
final bool updatedDevFS = await _updateDevFS();
|
||||||
if (!updatedDevFS)
|
if (!updatedDevFS)
|
||||||
return new OperationResult(1, 'DevFS Synchronization Failed');
|
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);
|
await _launchFromDevFS(package, mainPath);
|
||||||
restartTimer.stop();
|
restartTimer.stop();
|
||||||
printTrace('Restart performed in '
|
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.
|
// Flutter extension methods.
|
||||||
|
|
||||||
// Invoke a flutter extension method, if the flutter extension is not
|
// Invoke a flutter extension method, if the flutter extension is not
|
||||||
|
Loading…
Reference in New Issue
Block a user