{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/fresco/issues/821","labels_url":"https://api.github.com/repos/facebook/fresco/issues/821/labels{/name}","comments_url":"https://api.github.com/repos/facebook/fresco/issues/821/comments","events_url":"https://api.github.com/repos/facebook/fresco/issues/821/events","html_url":"https://github.com/facebook/fresco/issues/821","id":121111388,"number":821,"title":"Fresco fails to load an image again after its reference is closed.","user":{"login":"ch4ndu","id":6201434,"avatar_url":"https://avatars.githubusercontent.com/u/6201434?v=3","gravatar_id":"","url":"https://api.github.com/users/ch4ndu","html_url":"https://github.com/ch4ndu","followers_url":"https://api.github.com/users/ch4ndu/followers","following_url":"https://api.github.com/users/ch4ndu/following{/other_user}","gists_url":"https://api.github.com/users/ch4ndu/gists{/gist_id}","starred_url":"https://api.github.com/users/ch4ndu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ch4ndu/subscriptions","organizations_url":"https://api.github.com/users/ch4ndu/orgs","repos_url":"https://api.github.com/users/ch4ndu/repos","events_url":"https://api.github.com/users/ch4ndu/events{/privacy}","received_events_url":"https://api.github.com/users/ch4ndu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/fresco/labels/needs-details","name":"needs-details","color":"f4a460"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-08T22:13:21Z","updated_at":"2015-12-10T22:42:42Z","closed_at":null,"body":"This is reproduced in a 3 step process.\r\n1. Load the image from a url into a simpledrawee by calling setImageUri()\r\n2.Use the same url to get the underlying bitmap through the new        \r\n        BaseDataSubscriber<CloseableReference<CloseableBitmap>>() call. \r\n[Fresco log.txt](https://github.com/facebook/fresco/files/56120/Fresco.log.txt)\r\n\r\n After step 2, I try to load the image at same URL into another SimpleDrawee through the setImageUri(). I get a \"Canvas: trying to use a recycled bitmap\" error.\r\n\r\n\r\nHere, I think Fresco didn't keep track of the image reference being closed(basically recycled the bitmap). In this case, when I make another request to the same url, it should go and do a Full Fetch.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/fresco/issues/comments/163775516","html_url":"https://github.com/facebook/fresco/issues/821#issuecomment-163775516","issue_url":"https://api.github.com/repos/facebook/fresco/issues/821","id":163775516,"user":{"login":"ch4ndu","id":6201434,"avatar_url":"https://avatars.githubusercontent.com/u/6201434?v=3","gravatar_id":"","url":"https://api.github.com/users/ch4ndu","html_url":"https://github.com/ch4ndu","followers_url":"https://api.github.com/users/ch4ndu/followers","following_url":"https://api.github.com/users/ch4ndu/following{/other_user}","gists_url":"https://api.github.com/users/ch4ndu/gists{/gist_id}","starred_url":"https://api.github.com/users/ch4ndu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ch4ndu/subscriptions","organizations_url":"https://api.github.com/users/ch4ndu/orgs","repos_url":"https://api.github.com/users/ch4ndu/repos","events_url":"https://api.github.com/users/ch4ndu/events{/privacy}","received_events_url":"https://api.github.com/users/ch4ndu/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T22:42:42Z","updated_at":"2015-12-10T22:42:42Z","body":"1. It is the SimpleDraweeView that draws to canvas\r\n2.  I put the bitmap into a mediasessionCompat object for its use. This is the code snippet\r\nmMediaSessionCompat.setMetadata(newMediaMetadataBuilder()\r\n                                    .putBitmap(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, bitmap) \r\n                                    .putBitmap(MediaMetadataCompat.METADATA_KEY_ART, bitmap)\r\n                                    .putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bitmap)\r\n                                    .build());\r\n\r\n3.I didn't realize I had to close that too. Will not closing that cause this bug?\r\n\r\nIn my testing, I saw this crash happen only on ICS. Lollipop and Marshmallow seems to be fine though."}}