'Unregister the client from the current SAMP Hub, stop the client and
disconnect from the Hub.'

def disconnect(self):

    if self.is_connected:
        try:
            self.client.unregister()
        finally:
            if self.client.is_running:
                self.client.stop()
            self.hub.disconnect()
