Commit 95b5a1e
fix(mac): Fix NaN crash in slider and synchronize native player disposal
Guard slider position calculation against division by zero to prevent NaN crashes in Material3 Slider semantics. Make native player disposal synchronous (matching Linux behavior) to ensure cleanup completes before ioScope cancellation, preventing audio leaks. Use runBlocking(frameDispatcher) to safely close bitmaps on the same dispatcher that rendering uses, avoiding use-after-free race conditions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 22ec8ae commit 95b5a1e
1 file changed
Lines changed: 24 additions & 29 deletions
File tree
- mediaplayer/src/jvmMain/kotlin/io/github/kdroidfilter/composemediaplayer/mac
Lines changed: 24 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
880 | 880 | | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
890 | 888 | | |
891 | | - | |
892 | | - | |
893 | 889 | | |
894 | 890 | | |
895 | | - | |
896 | 891 | | |
897 | 892 | | |
898 | 893 | | |
| |||
0 commit comments