Skip to content

Prevent RejectedExecutionException in async mode#20

Open
shwilliamson wants to merge 1 commit intoharjot-oberai:masterfrom
shwilliamson:Wrapper-onDetached-Cleanup
Open

Prevent RejectedExecutionException in async mode#20
shwilliamson wants to merge 1 commit intoharjot-oberai:masterfrom
shwilliamson:Wrapper-onDetached-Cleanup

Conversation

@shwilliamson
Copy link
Copy Markdown

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.

1 participant