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

Prevent RejectedExecutionException in async mode #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shwilliamson
Copy link

Thanks for this excellent library! I've noticed on some devices that use of the back button results in a RejectedExceutionException. It appears that the onDetachedFromWindow method is invoked which releases resources for the underlying shadowGenerator. The shadowGenerator shuts down its thread pool. If this wrapper is reused afterwards in async mode, a crash occurs when tasks are submitted to this thread pool. A simple fix seems to be simply nulling out this underlying shadowGenerator so that a new one will be constructed if needed.

…ed after being detached from the window.

This happens on some devices when the back button is used.  The fix is to null it out so that a new underlying shadowGenerator is created (with a fresh thread pool that hasn't been shutdown).
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

Successfully merging this pull request may close these issues.

None yet

1 participant