'Do not call this function. It is for internal use at shutdown.'

def teardown(self):

    try:
        if (self._config and (u'restore_state' in self._config[u'core'])):
            if self._config[u'core'][u'restore_state']:
                self._save_state()
    except Exception as e:
        logger.warn(u'Unexpected    error    while    saving    state:    %s', str(e))
