media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
916 stars 132 forks source link

chore: adding missing dispose #823

Open abdelaziz-mahdy opened 2 weeks ago

abdelaziz-mahdy commented 2 weeks ago

thanks to https://github.com/media-kit/media-kit/issues/776#issuecomment-2111430301 pointing out that we are missing some disposes, i added them to avoid memory leaks

also i moved the context lookup to didChangeDependencies to fix Looking up a deactivated widget's ancestor is unsafe.

the dispose is conditional to avoid wrong disposes when moving out of the fullscreen to normal player