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 leaksCodePudding 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