我在 FCL 代码中发现了一个不寻常的示例。
这是 System.IO.BinaryReader 中的方法:
protected virtual void Dispose(bool disposing) {
if (disposing) {
Stream copyOfStream = m_stream;
m_stream = null;
if (copyOfStream != null && !m_leaveOpen)
copyOfStream.Close();
}
m_stream = null;
m_buffer = null;
m_decoder = null;
m_charBytes = null;
m_singleChar = null;
m_charBuffer = null;
}
“copyOfStream”对执行逻辑有什么影响?