Shutdown of the application.

def shutdown(self, collector, success):
        """Shutdown of the application."""
        self.event.delegate(success)
        if collector is not None:
            collector.queue.put(None)
            collector.join()
        if not success:
            sys.exit(1)