rspec/rules/S4021/csharp/rule.adoc

22 lines
765 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The ``++SafeHandle++`` class provides a simpler and safer way to manage the life cycle of objects which contains un-managed pointers (``++IntPtr++``). When converting to ``++SafeHandle++`` all calls to ``++GC.KeepAlive++`` should be removed because they become unnecessary and could confuse maintainers if left in the code.
This rule raises an issue when a class is using ``++SafeHandle++`` and still contains calls to ``++GC.KeepAlive++``.
2021-04-28 16:49:39 +02:00
== See
https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.safehandle(v=vs.110).aspx[SafeHandle Reference]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
endif::env-github,rspecator-view[]