There's two problems here, which are somewhat related:
* This is the wrong place to put this code. This function updates the properties view when it sees that a property is being removed from the object for which it is showing the properties. It should not go and make some changes to other objects that happen to be selected.
* This does not work nicely together with the undo/redo system. Removing the property for each of the selected objects should be done using `RemoveProperty` undo command instances (or, since that may be a little sub-optimal, this command should be extended to store a list of objects).