When A-Shell itself exits, every handled owned by the process should be automatically deleted.
But when a mere RUN program terminates, only the regular file channels used by the program are closed. Sockets and database connection handles should remain alive (provided you have a way of remembering the handle).