fix & supress warning

This commit is contained in:
Sean Kaim
2017-04-12 14:58:52 -04:00
parent e2fb49037a
commit 9bf53c6b25

View File

@@ -60,11 +60,19 @@ namespace mRemoteNG.Tools
return NativeMethods.CloseHandle(SystemMenuHandle);
}
/* If we don't have the finalizer, then we get this warning: https://msdn.microsoft.com/library/ms182329.aspx (CA2216: Disposable types should declare finalizer)
* If we DO have the finalizer, then we get this warning: https://msdn.microsoft.com/library/ms244737.aspx (CA1063: Implement IDisposable correctly)
*
* Since the handle is likely going to be in use for the entierty of the process, the finalizer isn't very important since when we're calling it
* the process is likely exiting. Leaks would be moot once it exits. CA2216 is the lesser of 2 evils as far as I can tell. Suppress.
~SystemMenu()
{
Dispose(false);
}
*/
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2216:DisposableTypesShouldDeclareFinalizer")]
public new void Dispose()
{
Dispose(true);