Changeset 245076 in webkit
- Timestamp:
- May 8, 2019 4:37:59 PM (5 years ago)
- Location:
- trunk/Source/WebKitLegacy/mac
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKitLegacy/mac/ChangeLog
r245072 r245076 1 2019-05-08 Daniel Bates <dabates@apple.com> 2 3 [Legacy WebKit] REGRESSION (r238078): Crash in hardwareKeyboardAvailabilityChangedCallback() 4 https://bugs.webkit.org/show_bug.cgi?id=197724 5 <rdar://problem/49725959> 6 7 Reviewed by Tim Horton. 8 9 Speculative fix for race condition. Between the time we receive a kGSEventHardwareKeyboardAvailabilityChangedNotification 10 notification and when we schedule execution to run on the WebThread the WebView that notification 11 was for may no longer exist. Take out a weak ptr on the WebView when we receive the notification 12 and check that we still have it once we are running on the WebThread. 13 14 * WebView/WebHTMLView.mm: 15 (hardwareKeyboardAvailabilityChangedCallback): 16 1 17 2019-05-08 Timothy Hatcher <timothy@apple.com> 2 18 -
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
r244471 r245076 147 147 #import <wtf/RunLoop.h> 148 148 #import <wtf/SystemTracing.h> 149 #import <wtf/WeakObjCPtr.h> 149 150 150 151 #if PLATFORM(MAC) … … 821 822 { 822 823 ASSERT(observer); 824 auto weakWebView = WeakObjCPtr<WebHTMLView>((__bridge WebHTMLView *)observer); 823 825 WebThreadRun(^{ 824 WebHTMLView *webView = (__bridge WebHTMLView *)observer; 825 if (Frame* coreFrame = core([webView _frame])) 826 coreFrame->eventHandler().capsLockStateMayHaveChanged(); 826 if (auto webView = weakWebView.get()) { 827 if (auto* coreFrame = core([webView _frame])) 828 coreFrame->eventHandler().capsLockStateMayHaveChanged(); 829 } 827 830 }); 828 831 }
Note: See TracChangeset
for help on using the changeset viewer.