[This is a follow-up to bug 8672] The current way of the Inspector observing NSWindowWillCloseNotification in order to tell when to disassociate from the inspected WebFrame is wrong. Aside from the fact that it doesn't track the WebFrame's WebView's window and hostWindow as they change, a WebFrame can be deallocated while its WebView remains in a window. For example, this crashes Safari (which is why this bug is P1): 1. Open a frameset page. 2. Inspect an element in one of the frames. 3. Navigate to another page in the same tab. 4. Try to select a different node in the inspector.
Created attachment 8877 [details] Proposed patch
Comment on attachment 8877 [details] Proposed patch The same idea can be implemented with generic notifications, which may be cleaner (since WebFrame wouldn't need to know about inspectors).
Notification sure sounds better to me. TimH?
Comment on attachment 8877 [details] Proposed patch r=me. A WebFrame might need to know about it's inspectors in the future, so this is fine.
Committed revision 14906.