https://bugzilla.novell.com/show_bug.cgi?id=667325
https://bugzilla.novell.com/show_bug.cgi?id=667325#c0 Summary: TypesWithDisposableFieldsShouldBeDisposableRule doesn't detect fields which are instantiated with a ctor of a more derived class than its compile time type Classification: Mono Product: Mono: Tools Version: 2.10.x Platform: All OS/Version: All Status: NEW Severity: Normal Priority: P5 - None Component: Gendarme AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13 TypesWithDisposableFieldsShouldBeDisposableRule doesn't detect fields which are instantiated with a ctor of a more derived class than its compile time type Testcase: interface ISomeInterface { string Name { get; } } class A { private ISomeInterface someMember; public ISomeInterface SomeMember { get { if (someMember == null) someMember = new B(); return someMember; } } } class B : ISomeInterface, IDisposable { private FileStream stream; public string Name { get { return "test"; } } public B () { stream = new FileStream("whatever", FileMode.Append); } public void Dispose() { if (stream != null) stream.Dispose(); } } Discussed in: http://groups.google.com/group/gendarme/browse_thread/thread/a203238210bf9da7 Reproducible: Always -- 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. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
