def METHOD_NAME(self):
    self._cancelled = True
    self._ui_view.close()
    try:
        self._ui_lock.release()
    except RuntimeError:
        # We don't really care if it was held or not. Just make sure it's not held now
        pass