Created
July 2, 2013 23:44
-
-
Save christophercurrie/5914256 to your computer and use it in GitHub Desktop.
BitmapDecoder bug
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
Known issue: Stream opened for Uri is not closed until finalized unless BitmapCacheOption.OnLoad set | |
Both overloads of this method contain a bug, where a stream is opened for the Uri, which is not closed until the bitmap decoder is finalized, unless BitmapCacheOption.OnLoad is set. Since there is no Dispose() method, there is no way to force closing the stream, except for removing all references to the BitmapDecoder, and forcing finalization using GC.Collect(). | |
The workaround is to use the overload that takes a Stream, and dispose of the stream after you are done with the Decoder. | |
http://connect.microsoft.com/VisualStudio/feedback/details/344914/bitmapdecoder-not-releasing-file-lock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment