Home > Back-end >  Excuse me, using the new application in the function space, will automatically release at the end of
Excuse me, using the new application in the function space, will automatically release at the end of

Time:09-21

Excuse me, using the new application in the function space, will automatically release at the end of the function, need to be manually released at the end of the main function?

CodePudding user response:

As long as the program exits, all memory allocated by the operating system automatic recovery, but still suggest that show the delete, have a good habit, will not lead to memory leaks

CodePudding user response:

Don't need to delete shows release, or the memory will always be hold,
Important point, have new you must be delete, form the good habit, otherwise will be buried a lot of mines

CodePudding user response:

You so tangled, use smart Pointers, from, unique_ptr, weak_ptr is quite sweet
  • Related