This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove callback onUnbind, fix NPE in sendResult
There are 4 places where the callbacks in JobService#runningJobs are accessed: * start, where we initially stash the JobCallback * jobFinished, where we remove the JobCallback and use it to send the result * stop, where we remove the JobCallback and use it to send the result * onUnbind, where we weren't removing the JobCallback but were using it to send the result The problem is that JobCallback uses a provided Message to transmit results, which is immediately recycled by the system after being sent. Users were experiencing NPEs where onUnbind ran first, using the Message but leaving it in the runningJobs collection. Future calls to jobFinished would try and send the same Message after it had already been used. The fix was to make sure that onUnbind removes the JobCallback from the collection. This should solve GitHub issues #109 and #139. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=167070874
- Loading branch information
Showing
2 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters