The programme has ended, something has finished, and he has a sense of something having finished its course, and then all of a sudden he turns away and this other thing has just finished its course, this other person.
One of the things I learned the hard way was that it doesn't pay to get discouraged. Keeping busy and making optimism a way of life can restore your faith in yourself.