mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 13:03:11 +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);
|
||||
|
||||
@override
|
||||
void teardown() {
|
||||
Future<void> teardown() async {
|
||||
if (!_isSubScope) {
|
||||
CherryPick.closeRootScope();
|
||||
await CherryPick.closeRootScope();
|
||||
_scope = null;
|
||||
}
|
||||
// SubScope teardown не требуется
|
||||
|
||||
Reference in New Issue
Block a user