Segmentation fault handling

后端 未结 7 1336
轻奢々
轻奢々 2020-11-27 05:23

I have an application which I use to catch any segmentation fault or ctrl-c. Using the below code, I am able to catch the segmentation fault but the handler is being called

7条回答
  •  一向
    一向 (楼主)
    2020-11-27 05:54

    Well you could set a state variable and only free memory if its not set. The signal handler will be called everytime, you can't control that AFAIK.

提交回复
热议问题