BinaryReader.Dispose (Bool Disposing) erstellt einen lokalen Verweis auf Stream. Warum?
Ich habe ein ungewöhnliches Beispiel im FCL-Code gefunden.
Dies ist die Methode in 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;
}
Welche Auswirkungen auf die Ausführungslogik hat "copyOfStream"?