'Disconnect the destroyed slot if it was connected.'

def _disconnect_destroyed(self, name):

    try:
        partial_objs = self._partial_objs
    except AttributeError:
        return
    if (name in partial_objs):
        func = partial_objs[name]
        try:
            self[name].destroyed.disconnect(func)
        except (RuntimeError, TypeError):
            pass
        del partial_objs[name]
