How to detect when main thread terminates?

前端 未结 5 1238
难免孤独
难免孤独 2020-12-21 10:26

What I need to know:

I would like to detect when a the main thread (process?) terminates so that I can ensure certain actions are performed before i

5条回答
  •  情歌与酒
    2020-12-21 11:29

    Based on the documentation, it looks like the default application domain (the one your Main method is probably running in) will not receive the DomainUnload event.

    I don't know a built-in event that would do what you expect.

    You could define your own custom event, have interested parties register with it, and fire off the event just before you return from Main().

提交回复
热议问题