How to do something before process get killed in windows

前端 未结 3 2002
清酒与你
清酒与你 2021-01-14 14:26

My program need to occupy some resources. I want it to release those resources before exit. It\'s easy to achieve when the excutable exit normally. However, what if the user

3条回答
  •  盖世英雄少女心
    2021-01-14 15:18

    When the process is killed the rug is yanked out from under you. But the process's resources will be killed along with the process, so you don't need to clean them up. Ensuring e.g. file consistency, however, is a significantly more complicated story (similar to if the plug were yanked out).

提交回复
热议问题