This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed
packages/video_player/video_player Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1- ## NEXT
1+ ## 2.4.5
22
33* Ignores unnecessary import warnings in preparation for [ upcoming Flutter changes] ( https://github.com/flutter/flutter/pull/104231 ) .
4+ * Fixes an exception when a disposed VideoPlayerController is disposed again.
45
56## 2.4.4
67
Original file line number Diff line number Diff line change @@ -426,6 +426,10 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
426426
427427 @override
428428 Future <void > dispose () async {
429+ if (_isDisposed) {
430+ return ;
431+ }
432+
429433 if (_creatingCompleter != null ) {
430434 await _creatingCompleter! .future;
431435 if (! _isDisposed) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
33 widgets on Android, iOS, and web.
44repository : https://github.com/flutter/plugins/tree/main/packages/video_player/video_player
55issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
6- version : 2.4.4
6+ version : 2.4.5
77
88environment :
99 sdk : " >=2.14.0 <3.0.0"
Original file line number Diff line number Diff line change @@ -373,6 +373,17 @@ void main() {
373373 expect (await controller.position, isNull);
374374 });
375375
376+ test ('calling dispose() on disposed controller does not throw' , () async {
377+ final VideoPlayerController controller = VideoPlayerController .network (
378+ 'https://127.0.0.1' ,
379+ );
380+
381+ await controller.initialize ();
382+ await controller.dispose ();
383+
384+ expect (() async => await controller.dispose (), returnsNormally);
385+ });
386+
376387 test ('play' , () async {
377388 final VideoPlayerController controller = VideoPlayerController .network (
378389 'https://127.0.0.1' ,
You can’t perform that action at this time.
0 commit comments