I have a CryptoStream with an underlying Stream. I can't use a using block in order to dispose the CryptoStream because that also disposes the underlying Stream which I need to leave open. The solution seems to be simply to ignore the CryptoStream and just dispose of the Stream when needed. But perhaps it is important to keep a reference to the CryptoStream and dispose of it to prevent some resources leak?
Additionally, even if I don't dispose the CryptoStream might the GC dispose of it if it goes out of scope and then also dispose the underlying Stream, (which will be too early because I still need the Stream)?