Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB unplugged, resulting in the app being killed while loading the video cover #5377

Open
xintanggithub opened this issue Mar 5, 2024 · 0 comments

Comments

@xintanggithub
Copy link

Glide Version:4.16.0

Integration libraries:

Device/Android Version:Android 9

Issue details / Repro steps / Use case background: I am using Glide to load a video cover, and the video file is sourced from USB. Removing the USB during the loading process may cause a crash.
After investigation, it was found that Glide did not release MediaMetadataRetriever in a timely manner, even if clear or onDestroy was called.
Finally, upon checking the source code, I found that the release of MediaMetadataRetriever only occurs after the completion of the decodeFrame, and is not affected by clear or onDestroy, ultimately resulting in failure to release it in a timely manner and crashing.
To be precise, this is not a crash, but a low-level protection mechanism. After the USB is unplugged, processes that are still illegally accessed will be killed by void.

static class MediaMetadataRetrieverFactory { public MediaMetadataRetriever build() { return new MediaMetadataRetriever(); } }
So I hope that in future versions, such holdings can be released in a timely manner in clear or onDestroy, instead of being uncontrollable, and the intelligence will only be released after the internal code process is completed.

Glide load line / GlideModule (if any) / list Adapter code (if any):

Glide.with...

Layout XML:

<FrameLayout xmlns:android="...

Stack trace / LogCat:

paste stack trace and/or log here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant