Hi all,
We in the team have an issue|debit about the coding standard in terms in memory management.
We have 2 codes that we proposed and we need to choose the better one.
// code1
vsCode:{ object o1 = null; try { using (o1 = new object} { // code here } } catch { // code here } finally { o1 = null; } }
code2
Code2 dispose the object but not set to null. And if you what is your choice? code 1 or code 2. Any inputs, idea. Thanks!Code:{ try { using (object o1 = new object} { // code here } } catch { // code here } }
Popskie




Reply With Quote