[Mono-bugs] [Bug 651493] EnsureLocalDisposalRule is missing some defects

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Nov 21 08:27:55 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=651493

https://bugzilla.novell.com/show_bug.cgi?id=651493#c2


--- Comment #2 from Antoine Vandecrème <avandecreme at sopragroup.com> 2010-11-21 13:27:54 UTC ---
I just create a new branch on github and make a pull request which contains the
previous patch with a typo fix : https://github.com/mono/mono-tools/pull/4

About lowering the confidence when the IDisposable object is pass to a method,
we must define exactly what we want in those cases :


public void FooMethod()
{
    var reader = new XmlReader("foo.xml");
}
>> High, no doubt here


public void FooMethod()
{
    var reader = new XmlReader("foo.xml");
    reader.ToString();
}
>> High ? because the ToString method is not the Dispose method (and probably doesn't call Dispose).

public void FooMethod()
{
    var xslt = new System.Xml.Xsl.XslCompiledTransform ();
    var reader = new XmlReader("foo.xml");
    xslt.Load (reader);
}
>> Low ? because the Load method maybe dispose the reader

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list