8 lines
669 B
Plaintext
8 lines
669 B
Plaintext
![]() |
== Why is this an issue?
|
||
|
|
||
|
When calling the `BeginInvoke` method of a https://learn.microsoft.com/en-us/dotnet/api/system.delegate[delegate], resources are allocated that are only freed up when `EndInvoke` is called. Failing to pair `BeginInvoke` with `EndInvoke` can lead to https://en.wikipedia.org/wiki/Resource_leak[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.
|