Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. C# MemoryStream leaking memory, after disposing/close/etc?
  2. byte[] bData = System.IO.File.ReadAllBytes( "F:\application_exit_bw.png" );
  3. using( System.IO.MemoryStream hMemoryStreamOutput = new System.IO.MemoryStream())
  4. {
  5.     for ( int i = 0; i < 10000; i++ ) hMemoryStreamOutput.Write( bData, 0, bData.Length );
  6. }
  7. Thread.Sleep(Timeout.Infinite);