Changeset 245975 in webkit
- Timestamp:
- May 31, 2019 11:56:36 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r245972 r245975 1 2019-05-31 Alexey Proskuryakov <ap@apple.com> 2 3 WebKitTestRunner sometimes freezes under -[NSWindow release] 4 https://bugs.webkit.org/show_bug.cgi?id=198422 5 6 Reviewed by Tim Horton. 7 8 The window remains key until it's out of the allWindows vector, and AppKit is not 9 happy about deallocating key windows. Fixed by updating allWindows in -close 10 instead of -release. 11 12 Added isMainFrame assertions in code that manipulates allWindows for a good measure. 13 14 * WebKitTestRunner/mac/WebKitTestRunnerWindow.mm: 15 (+[WebKitTestRunnerWindow _WTR_keyWindow]): 16 (-[WebKitTestRunnerWindow initWithContentRect:styleMask:backing:defer:]): 17 (-[WebKitTestRunnerWindow close]): 18 (-[WebKitTestRunnerWindow dealloc]): 19 1 20 2019-05-31 Geoffrey Garen <ggaren@apple.com> 2 21 -
trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm
r235837 r245975 28 28 29 29 #import "PlatformWebView.h" 30 #import <wtf/MainThread.h> 30 31 #import <wtf/Vector.h> 31 32 … … 38 39 + (WebKitTestRunnerWindow *)_WTR_keyWindow 39 40 { 41 ASSERT(isMainThread()); 40 42 for (auto window : allWindows) { 41 43 if ([window isKeyWindow]) … … 47 49 - (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation 48 50 { 51 ASSERT(isMainThread()); 49 52 allWindows.append(self); 50 53 return [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; 51 54 } 52 55 56 - (void)close 57 { 58 ASSERT(isMainThread()); 59 ASSERT(allWindows.contains(self)); 60 allWindows.removeFirst(self); 61 ASSERT(!allWindows.contains(self)); 62 [super close]; 63 } 64 53 65 - (void)dealloc 54 66 { 55 allWindows.removeFirst(self);56 ASSERT(!allWindows.contains(self)); 67 ASSERT(isMainThread()); 68 ASSERT(!allWindows.contains(self)); // The window needs to stop being key before deallocation, otherwise AppKit spins waiting for this to happen (see <rdar://problem/50948871>). 57 69 [super dealloc]; 58 70 }
Note: See TracChangeset
for help on using the changeset viewer.