Merge "Ensure view is attached to window before removing it" into sc-dev