Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

30 lines
834 B
Plaintext

== Why is this an issue?
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++``.
== Resources
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)
=== Message
Remove this call to 'GC.KeepAlive'.
=== Highlighting
Call to GC.KeepAlive
endif::env-github,rspecator-view[]