Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Disposing stream from camera

$
0
0

Hi, I've got a quick question that I could not find a satisfactory answer to.
In my app (iOS for now) a user selects an image from a gallery or takes a picture with a camera on one page, and later on (two pages later) I show it to him again and then upload it to a web server. I keep the picture in the MemoryStream in the static class in my App.cs in the meantime so that I can put it into StreamContent when I upload it.

My question is - does this stream gets copied when I pass it as a parameter or is it just a pointer? And also when and how is it safe to dispose it given that the user can come back to the first page through back button navigation.

So far the app has never thrown a memory warning (both on the devices and the simulator), but I would really like to handle it properly. I would really appreciate if anyone could help me figure it out. Thank you.


Viewing all articles
Browse latest Browse all 77050

Trending Articles