Quantcast
Channel: Answers for "How important is it to wrap temp variables/objects in a "using" block?"
Viewing all articles
Browse latest Browse all 8

Answer by Owen-Reynolds

$
0
0
Not an expert, but USING isn't for garbage collection. It's for "special" things like files, to be absolutely sure the Close statement gets called in every single case. I'd guess that the actual memory used for the file variable isn't even GCed any faster than normal. Since Unity wants you to use `Resource` to read files, hopefully they have all the correct USING's buried inside there.

Viewing all articles
Browse latest Browse all 8

Trending Articles



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