'Clean up the resoures when exits
:param self: An AccessPoint object
:type self: AccessPoint
:return: None
:rtype: None'

def on_exit(self):

    subprocess.call('pkill    dnsmasq', shell=True)
    try:
        self.hostapd_object.stop()
    except BaseException:
        subprocess.call('pkill    hostapd', shell=True)
        if os.path.isfile(hostapd_constants.HOSTAPD_CONF_PATH):
            os.remove(hostapd_constants.HOSTAPD_CONF_PATH)
    if os.path.isfile('/var/lib/misc/dnsmasq.leases'):
        os.remove('/var/lib/misc/dnsmasq.leases')
    if os.path.isfile('/tmp/dhcpd.conf'):
        os.remove('/tmp/dhcpd.conf')
