Does a c++ program automatically free memory when it crashes?

后端 未结 2 1388
孤城傲影
孤城傲影 2021-01-05 11:00

I read in Google c++ coding standards that Google does not use exception. If exception is not used, how do you free memory when errors occur in your program?

For ex

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 11:06

    The operating system cleans up all used memory and file handles when a process is terminated for whatever reason.

提交回复
热议问题