Arun, I just want to add a note to the correct answer by C Pallini.
Even though you should not worry about releasing of memory on application termination (it will also be released, as
most of other resources), you should always release your heap memory on every step.
One obvious reason is preventing
memory leaks (
http://en.wikipedia.org/wiki/Memory_leak[
^]).
Another reason should make you taking care even about the objects allocating memory only once. In practice, a failure to release memory would not affect the behavior of your application. However, it would be bad for maintainability of your code. It might happen that latter on you will need to fight a memory leak or use some
memory debugger by any reasons; so the memory debugger will detect false positives for you, effectively preventing to find "real" memory leaks.
A memory debugger can be a dear friend to you, don't betray it by lousy or careless memory management. About memory debuggers:
http://en.wikipedia.org/wiki/Memory_debugger[
^].
—SA