<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def disconnect(self):
 """ Disconnects the tree connection. """

        if not self._connected:
            return

        log.info("Session: %s, Tree: %s - Disconnecting from Tree Connect"
                 % (self.session.username, self.share_name))

        req = SMB2TreeDisconnect()
        log.info("Session: %s, Tree: %s - Sending Tree Disconnect message"
                 % (self.session.username, self.share_name))
        log.debug(str(req))
        request = self.session.connection.send(req,
                                               sid=self.session.session_id,
                                               tid=self.tree_connect_id)

        log.info("Session: %s, Tree: %s - Receiving Tree Disconnect response"
                 % (self.session.username, self.share_name))
        res = self.session.connection.receive(request)
        res_disconnect = SMB2TreeDisconnect()
        res_disconnect.unpack(res['data'].get_value())
        log.debug(str(res_disconnect))
        self._connected = False
        del self.session.tree_connect_table[self.tree_connect_id]