def purge_block(data_blocks):
    """Remove all unused object blocks."""
    counter = 0
    for block in data_blocks:
        if block.users == 0:
            data_blocks.remove(block)
            counter += 1
    return counter