glide icon indicating copy to clipboard operation
glide copied to clipboard

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

Open xintanggithub opened this issue 1 year ago • 0 comments
trafficstars

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

xintanggithub avatar Mar 05 '24 06:03 xintanggithub