I’ve read conflicting opinions as to whether every BeginInvoke() has to be matched by an EndInvoke(). Are there any leaks or other problems associated with NOT calling EndInvoke()?
I’ve read conflicting opinions as to whether every BeginInvoke() has to be matched by
Share
Delegate.EndInvoke is documented as a thou shalt call this (i.e. necessary – else leaks happen) – from msdn:
Control.EndInvoke is OK to ignore for fire-and-forget methods – from msdn:
However – if you are using
Delegate.BeginInvokeand don’t want the result, consider usingThreadPool.QueueUserWorkIteminstead – it’ll make life a lot easier, and avoid the pain ofIAsyncResultetc.