Right now, your list<TreeNode>
destroys itself because the program has terminated, but now let's say you are in a situation where you are using local list<TreeNode>
objects that are created and destroyed in a loop or something similar. That memory leak now turns into something you do have to worry about.
Bottom line is your code shouldn't leak, regardless of the situation. The only exception maybe singleton or similar patterns, where there may be some justification for letting the object "die without cleanup". But for something like a list class, absolutely no leaks should be present.
In addition, what if the process is not supposed to shut down? What if it is a mission critical app that must run 24 hours, every day? That leak now turns into a disaster -- it is you or that (now angry) coworker who will get that phone call in the middle of the night trying to restart the system due to the resources being exhausted.