def METHOD_NAME(self):
    """Stop the main process."""
    if self.mainProcess:
        self.mainProcess.terminate()
        if self.mainThread:
            self.mainThread.join()
    self.mainProcess = None
    self.mainThread = None