mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-11 13:17:13 +00:00
Previously, when removing a view, Cappuccino didn't clean the notification center. The notification center kept in reference old views. This PR fix this issue. When a CPView is added to a view, the methods _removeObservers and _addObservers are called. In these both methods we remove and add the observer to the notification center if needed. _removeObservers and _addObservers are called for the view and its subviews. These both methods are called through the method viewWillMoveToSuperview. When a CPView is removed, we only call the method _removeObservers. When a CPWindow is closed, we call the method _removeObservers on its contentView. When a CPWindow is about to be opened, we call the method _removeObservers and _addObservers on its contentView. Refs #1880 Refs #2024 Test app in Tests/Manual/AttachedSheet2/SheetWindowController.j