Mac: Speculative fix for [Cocoa Zombie] -[BrowserWindowController release]
Reported crashes suggest a situation where we may double-free a BrowserWindowController. Stacks show a UAF while trying to release a reference to |self| held by an ObjC closure. The free occurs on an autorelease triggered by a closure. Most likely these are happening on the same closure. That is __NSFireDelayedPerform "free()s" and its __delayedPerformCleanup immediately tries to access to free again. One hypothetical way this could occur would be if AppKit invoked -[BrowserWindowController windowWillClose:] multiple times. Each time would post a delayed autorelease closure. When the second is executed, it would create the situation described. Protect against this with an early exit in windowWillClose: if it's already been called. BUG=671213 Review-Url: https://codereview.chromium.org/2597023002 Cr-Commit-Position: refs/heads/master@{#441282}
Showing
Please register or sign in to comment