Not really, StorageFile::OpenReadAsync()
returns a IAsyncOperation<IRandomAccessStreamWithContentType>^
which is an asynchronous operation.
This operation creates and holds a reference to the IRandomAccessStream
, when the operation is done, the PPL tasks get a reference to this stream through IAsyncOperation<TResult>::GetResults()
and they hold the reference, at least, until the second lambda function is done (the lambda function in the second then()
).
After that, if the BitmapImage
holds another reference to the stream, then the stream won't be disposed for a "long" time.
If you would like to dig more into this topic, you may be able to create your own implementation of IRandomAccessStream
interface and put a breakpoint in the Dispose method.