diff --git a/dio/lib/src/adapters/io_adapter.dart b/dio/lib/src/adapters/io_adapter.dart index cfdd26ae2..cbe19879c 100644 --- a/dio/lib/src/adapters/io_adapter.dart +++ b/dio/lib/src/adapters/io_adapter.dart @@ -104,9 +104,9 @@ class IOHttpClientAdapter implements HttpClientAdapter { request = await reqFuture; } - final wr = WeakReference(request); + final requestWR = WeakReference(request); cancelFuture?.whenComplete(() { - wr.target?.abort(); + requestWR.target?.abort(); }); // Set Headers diff --git a/plugins/http2_adapter/lib/src/http2_adapter.dart b/plugins/http2_adapter/lib/src/http2_adapter.dart index fc08ceb8d..77c747d2f 100644 --- a/plugins/http2_adapter/lib/src/http2_adapter.dart +++ b/plugins/http2_adapter/lib/src/http2_adapter.dart @@ -288,7 +288,7 @@ class Http2Adapter implements HttpClientAdapter { onClose: () { responseSubscription.cancel(); responseSink.close(); - stream.outgoingMessages.close(); + streamWR.target?.outgoingMessages.close(); }, ); }