Commit 8023527
authored
fix: Dispose codec after completing frame creation (flutter#159945)
ref flutter#93404,
[comment](flutter#93404 (comment))
and
[comment](flutter#93404 (comment)).
Added a process to call `ui.Codec`'s `dispose`.
With this change,
[HtmlBlobCodec](https://github.com/flutter/flutter/blob/8e0993eda8b0bbf0e11162cf18df1effd134db09/engine/src/flutter/lib/web_ui/lib/src/engine/html_image_element_codec.dart#L100)'s
dispose will be called in Safari when using CanvasKit, and
`revokeObjectURL` will be executed as expected.
* https://api.flutter.dev/flutter/dart-ui/Codec/dispose.html
* https://bugs.webkit.org/show_bug.cgi?id=31253
*
https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static
*
https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL_static
If this fix looks good, I will open the
flutter#161481 to remove the
`AlearmClock` from the `BrowserImageDecoder`.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md1 parent b37e7aa commit 8023527
File tree
5 files changed
+73
-5
lines changed- engine/src/flutter/lib
- ui
- web_ui/lib
- packages/flutter
- lib/src/painting
- test/painting
5 files changed
+73
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2630 | 2630 | | |
2631 | 2631 | | |
2632 | 2632 | | |
2633 | | - | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
2634 | 2639 | | |
2635 | 2640 | | |
2636 | 2641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
699 | 704 | | |
700 | 705 | | |
701 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
983 | | - | |
| 983 | + | |
| 984 | + | |
984 | 985 | | |
985 | 986 | | |
986 | 987 | | |
| |||
1071 | 1072 | | |
1072 | 1073 | | |
1073 | 1074 | | |
| 1075 | + | |
1074 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1075 | 1080 | | |
1076 | 1081 | | |
1077 | 1082 | | |
| |||
1105 | 1110 | | |
1106 | 1111 | | |
1107 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1108 | 1118 | | |
1109 | 1119 | | |
1110 | 1120 | | |
| |||
1119 | 1129 | | |
1120 | 1130 | | |
1121 | 1131 | | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1122 | 1135 | | |
1123 | 1136 | | |
1124 | 1137 | | |
| |||
1161 | 1174 | | |
1162 | 1175 | | |
1163 | 1176 | | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1164 | 1180 | | |
1165 | 1181 | | |
1166 | 1182 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
106 | 118 | | |
107 | 119 | | |
108 | 120 | | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
| 146 | + | |
133 | 147 | | |
134 | 148 | | |
135 | 149 | | |
| |||
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
| 173 | + | |
159 | 174 | | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| |||
334 | 350 | | |
335 | 351 | | |
336 | 352 | | |
| 353 | + | |
337 | 354 | | |
338 | 355 | | |
339 | 356 | | |
| |||
362 | 379 | | |
363 | 380 | | |
364 | 381 | | |
| 382 | + | |
365 | 383 | | |
| 384 | + | |
366 | 385 | | |
367 | 386 | | |
368 | 387 | | |
| |||
420 | 439 | | |
421 | 440 | | |
422 | 441 | | |
| 442 | + | |
423 | 443 | | |
| 444 | + | |
424 | 445 | | |
425 | 446 | | |
426 | 447 | | |
| |||
469 | 490 | | |
470 | 491 | | |
471 | 492 | | |
| 493 | + | |
472 | 494 | | |
| 495 | + | |
473 | 496 | | |
474 | 497 | | |
475 | 498 | | |
| |||
505 | 528 | | |
506 | 529 | | |
507 | 530 | | |
| 531 | + | |
508 | 532 | | |
| 533 | + | |
509 | 534 | | |
510 | 535 | | |
511 | 536 | | |
| |||
562 | 587 | | |
563 | 588 | | |
564 | 589 | | |
| 590 | + | |
565 | 591 | | |
| 592 | + | |
566 | 593 | | |
567 | 594 | | |
568 | 595 | | |
| |||
619 | 646 | | |
620 | 647 | | |
621 | 648 | | |
| 649 | + | |
622 | 650 | | |
| 651 | + | |
623 | 652 | | |
624 | 653 | | |
625 | 654 | | |
| |||
653 | 682 | | |
654 | 683 | | |
655 | 684 | | |
| 685 | + | |
656 | 686 | | |
| 687 | + | |
657 | 688 | | |
658 | 689 | | |
659 | 690 | | |
| |||
699 | 730 | | |
700 | 731 | | |
701 | 732 | | |
| 733 | + | |
702 | 734 | | |
| 735 | + | |
703 | 736 | | |
704 | 737 | | |
705 | 738 | | |
| |||
734 | 767 | | |
735 | 768 | | |
736 | 769 | | |
| 770 | + | |
737 | 771 | | |
738 | 772 | | |
739 | 773 | | |
| |||
772 | 806 | | |
773 | 807 | | |
774 | 808 | | |
| 809 | + | |
775 | 810 | | |
776 | 811 | | |
777 | 812 | | |
| |||
918 | 953 | | |
919 | 954 | | |
920 | 955 | | |
| 956 | + | |
921 | 957 | | |
| 958 | + | |
922 | 959 | | |
923 | 960 | | |
924 | 961 | | |
| |||
0 commit comments