'Release the resources associated to the queues of this instance'

def clear_queues(self, manager):

    for q in (self.to_q, self.from_q):
        if (q is None):
            continue
        if (not manager):
            q.close()
            q.join_thread()
    self.to_q = self.from_q = None
