File tree Expand file tree Collapse file tree 2 files changed +771
-557
lines changed Expand file tree Collapse file tree 2 files changed +771
-557
lines changed Original file line number Diff line number Diff line change @@ -1001,9 +1001,15 @@ class _GetItImplementation implements GetIt {
1001
1001
1002
1002
if (factoryToRemove.instance != null ) {
1003
1003
if (disposingFunction != null ) {
1004
- await disposingFunction.call (factoryToRemove.instance as T );
1004
+ final dispose = disposingFunction.call (factoryToRemove.instance as T );
1005
+ if (dispose is Future ) {
1006
+ await dispose;
1007
+ }
1005
1008
} else {
1006
- await factoryToRemove.dispose ();
1009
+ final dispose = factoryToRemove.dispose ();
1010
+ if (dispose is Future ) {
1011
+ await dispose;
1012
+ }
1007
1013
}
1008
1014
}
1009
1015
}
@@ -1036,9 +1042,15 @@ class _GetItImplementation implements GetIt {
1036
1042
1037
1043
if (instanceFactory.instance != null ) {
1038
1044
if (disposingFunction != null ) {
1039
- await disposingFunction.call (instanceFactory.instance as T );
1045
+ final dispose = disposingFunction.call (instanceFactory.instance as T );
1046
+ if (dispose is Future ) {
1047
+ await dispose;
1048
+ }
1040
1049
} else {
1041
- await instanceFactory.dispose ();
1050
+ final dispose = instanceFactory.dispose ();
1051
+ if (dispose is Future ) {
1052
+ await dispose;
1053
+ }
1042
1054
}
1043
1055
}
1044
1056
You can’t perform that action at this time.
0 commit comments