rspec/rules/S4021/rule.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

11 lines
574 B
Plaintext

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++``.
== See
https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.safehandle(v=vs.110).aspx[SafeHandle Reference]