Should I free allocated memory on abnormal termination?

后端 未结 7 1799
無奈伤痛
無奈伤痛 2021-01-17 12:34

My program (a text-mode web browser) is dynamically allocating memory.

I do free unneeded blocks during runtime, of course. And I do free everything before normal te

7条回答
  •  生来不讨喜
    2021-01-17 12:57

    Only if your OS doesn't reclaim memory on program termination. DOS and its 'sticky memory' is an example of such an OS. On most modern OS not free()'ing on abnormal termination is a non-issue.

提交回复
热议问题