Skip to content

Commit 69090a0

Browse files
Fix lifecycle issue in DTDManager (#9200)
* Fix lifecycle issue in DtdManager * changelog
1 parent 366cb3e commit 69090a0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/devtools_app_shared/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ getter.
1010
`package:devtools_app_shared/service.dart` library to the
1111
`package:devtools_app_shared/utils.dart` library.
1212
* Fix alignment issues in `DevToolsClearableTextField`.
13+
* Fix a lifecycle issue with `DTDManager`.
1314

1415
## 0.3.1
1516
* Bump `vm_service` dependency to `>=13.0.0 <16.0.0`.

packages/devtools_app_shared/lib/src/service/dtd_manager.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ class DTDManager {
3333
await disconnect();
3434

3535
try {
36-
_connection.value = await DartToolingDaemon.connect(uri);
36+
final connection = await DartToolingDaemon.connect(uri);
3737
_uri = uri;
38+
// Set this after setting the value of [_uri] so that [_uri] can be used
39+
// by any listeners of the [_connection] notifier.
40+
_connection.value = connection;
3841
_log.info('Successfully connected to DTD at: $uri');
3942
} catch (e, st) {
4043
onError?.call(e, st);

0 commit comments

Comments
 (0)