c# - SystemOutOfMemory exception after working with Stream -


This function rotates the image stream at 90 degrees, after calling it 5-6 times on Windows Phone, give me the SystemOutOfMemory exception

  got private writeable bitmap _rot (stream stream) found {var bmp = new bitmapImage (); Bmp.SetSource (stream); Var src = new writable bitmap (BMP); Var w = src.PixelWidth; Var h = src.PixelHeight; Var p = src.Pixels; Var dst = new writable bitmap (h, w); Var i = 0; Var RP = DST. Pixel; For (var x = 0; x  = 0; y--) {var srcInd = y * w + x; RP [I] = P [srcInd]; I ++; }} / * Is trying to free the memory, but nothing of that task * / // bmp = null; // src = null; Return DST; }   

I know that the problem in that function, when I'm not calling - all work fine.

Try to use it:

  Compile (); GC.WaitForPendingFinalizers ();    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -