Do we need to call EndInvoke() and close the wait handle after calling a delegate BeginInvoke() even when we do not need to wait for the result?
Any resource leak if do not do so?
Do we need to call EndInvoke() and close the wait handle after calling a
Share
Yes; you do always need to call
EndInvoke().Otherwise, .Net will hold the result forever, in case you eventually do call
EndInvoke().If you want a “fire and forget it” asynchronous invocation (or even if you don’t), you should use the
Taskclass, which is much nicer.