When a process exits, any files it left open are closed and all of its memory is released.
There are some other kinds of system resources that a process can "leak" and leave around on exit. I think a GUI process using an X server can leave resource leaks in the X server.
The simple stuff (open files and the process's own memory) are recovered on exit, but other things might not be. I don't have the details on the things that might be leaked, just occasional painful experience.
Quote:
Originally Posted by wj123
In the child process, it creates a object using new but does not delete it.
|
That is one of the simple ones, entirely in the process's own memory. Entirely cleaned up on process exit; No problem.