bumptech / bumptech/glide

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

Open
#5,377 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**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)**:
```java
Glide.with...
```

**Layout XML**:
```xml

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.