How to dispose objects having asynchronous methods called?

后端 未结 7 2146
再見小時候
再見小時候 2020-12-18 21:34

I have this object PreloadClient which implements IDisposable, I want to dispose it, but after the asynchronous methods finish their call... which

7条回答
  •  無奈伤痛
    2020-12-18 22:37

    I have a few ideas:

    1. change your architecture.
    2. dispose in the handler
    3. use EventWaitHandle

提交回复
热议问题