The node you are looking for is at should_quit.