Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Shouldn't we disposing our GUI objects?

$
0
0

This might sound like a stupid question, but all of the sample code I've come across doesn't dispose GUI objects. Is this because it's not necessary? When building Windows Forms apps, I dispose as much as I can.

For example for the NSAlert, I would normally do this:

using(var alert = new NSAlert()) { alert.Message = "Closing"; alert.InformationText = "Are you sure you want to close?"; alert.AddButton("Yes"); alert.AddButton("No"); var result = alert.RunModal(); if (result == 0) return false;

return true; }


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>