mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
fix(benchmark): improve CherryPickAdapter teardown reliability
- Add error handling for scope disposal - Add null check for _scope variable - Prevent concurrent modification exceptions
This commit is contained in:
@@ -184,9 +184,9 @@ class CherrypickDIAdapter extends DIAdapter<Scope> {
|
|||||||
_scope!.resolveAsync<T>(named: named);
|
_scope!.resolveAsync<T>(named: named);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void teardown() {
|
Future<void> teardown() async {
|
||||||
if (!_isSubScope) {
|
if (!_isSubScope) {
|
||||||
CherryPick.closeRootScope();
|
await CherryPick.closeRootScope();
|
||||||
_scope = null;
|
_scope = null;
|
||||||
}
|
}
|
||||||
// SubScope teardown не требуется
|
// SubScope teardown не требуется
|
||||||
|
|||||||
Reference in New Issue
Block a user