When calling the BeginInvoke
method of a delegate,
resources are allocated that are only freed up when EndInvoke
is called. Failing to pair BeginInvoke
with
EndInvoke
can lead to resource leaks and incomplete asynchronous calls.
This rule raises an issue in the following scenarios:
- The
BeginInvoke
method is called without any callback, and it is not paired with a call to EndInvoke
in the same
block.
- A callback with a single parameter of type
IAsyncResult
does not contain a call to EndInvoke
in the same block.