forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMissingDisposeMethod.qhelp
More file actions
31 lines (25 loc) · 856 Bytes
/
Copy pathMissingDisposeMethod.qhelp
File metadata and controls
31 lines (25 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>Classes that implement <code>IDisposable</code> and have members of <code>IDisposable</code> type
should also declare/override <code>Dispose()</code>.
</p>
</overview>
<recommendation>
<p>Override the <code>Dispose()</code> method.</p>
</recommendation>
<example>
<p>In the following example, <code>Bad</code> extends the <code>IDisposable</code> class <code>BadBase</code>,
but does not override <code>Dispose()</code>.
</p>
<sample src="MissingDisposeMethodBad.cs" />
<p>In the revised example, <code>Good</code> overrides <code>Dispose()</code>.
</p>
<sample src="MissingDisposeMethodGood.cs" />
</example>
<references>
<li>MSDN: <a href="https://msdn.microsoft.com/en-us/library/system.idisposable.aspx">IDisposable Interface</a>.</li>
</references>
</qhelp>