madsleejensen / react-native-image-sequence

native implementation for creating frame based image animations
MIT License
107 stars 67 forks source link

Fix crash when not being able to schedule task on busy devices #6

Closed skovhus closed 7 years ago

skovhus commented 7 years ago

Old Android devices running newer version of React Native (0.40+) we observed the task thread pool to be exhausted. It fails with an java.util.concurrent.ThreadPoolExecutor exception.

To avoid crashing the app, this PR catches this exception.

I guess the underlying issue is that we load the same image multiple times. So if this lib is used for showing a list of images inside a component, then every time this component is loaded (or if there is multiple instances of it on a page), then we will spawn an async task.

Maybe react-native-image-sequence should cache which images is already loaded?

madsleejensen commented 7 years ago

LGTM 👍 yeah caching + lazy loading images (for very large image-sets) would be nice!