This does not remove any links that are part of the mainObj. Nor does it remove any links that belong to a view, if this port is part of a document. And conversely, it does not remove any links that belong to a document if this port is part of a view. Finally, this calls ClearLinks only when ClearsLinksWhenRemoved is true.