Release resources when stop debugging

后端 未结 1 777
独厮守ぢ
独厮守ぢ 2021-01-25 23:15

I use Visual Studio 2005 & C#. In my FormClosing event I release some resources, that my application uses. But when I debug it and decide to stop (Stop debugging), than Form

相关标签:
1条回答
  • 2021-01-25 23:35

    If you by "resources" mean things like open handles and allocated memory, you shouldn't worry. The OS will release this as the process terminates.

    If you mean things like temporary files, registry keys, or other things that are committed to disk that you want to clean up after yourself, I'm afraid you won't be able to catch that when terminating the program, and will have to clean it up manually or on next start. To my knowledge, at least. :)

    0 讨论(0)
提交回复
热议问题