WebKit Bugzilla
Attachment 371065 Details for
Bug 198422
: WebKitTestRunner sometimes freezes under -[NSWindow release]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed fix
WebKitTestRunnerWindowAllWindows.txt (text/plain), 2.66 KB, created by
Alexey Proskuryakov
on 2019-05-31 09:51:25 PDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Alexey Proskuryakov
Created:
2019-05-31 09:51:25 PDT
Size:
2.66 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 245966) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,22 @@ >+2019-05-31 Alexey Proskuryakov <ap@apple.com> >+ >+ WebKitTestRunner sometimes freezes under -[NSWindow release] >+ https://bugs.webkit.org/show_bug.cgi?id=198422 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The window remains key until it's out of the allWindows vector, and AppKit is not >+ happy about deallocating key windows. Fixed by updating allWindows in -close >+ instead of -release. >+ >+ Added isMainFrame assertions in code that manipulates allWindows for a good measure. >+ >+ * WebKitTestRunner/mac/WebKitTestRunnerWindow.mm: >+ (+[WebKitTestRunnerWindow _WTR_keyWindow]): >+ (-[WebKitTestRunnerWindow initWithContentRect:styleMask:backing:defer:]): >+ (-[WebKitTestRunnerWindow close]): >+ (-[WebKitTestRunnerWindow dealloc]): >+ > 2019-05-31 Alex Christensen <achristensen@webkit.org> > > REGRESSION (Safari 12): SafariForWebkitDevelopment won't load any pages on Mojave, nightly builds broken >Index: Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm >=================================================================== >--- Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm (revision 245786) >+++ Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm (working copy) >@@ -27,6 +27,7 @@ > #import "WebKitTestRunnerWindow.h" > > #import "PlatformWebView.h" >+#import <wtf/MainThread.h> > #import <wtf/Vector.h> > > @implementation WebKitTestRunnerWindow >@@ -37,6 +38,7 @@ static Vector<WebKitTestRunnerWindow *> > > + (WebKitTestRunnerWindow *)_WTR_keyWindow > { >+ ASSERT(isMainThread()); > for (auto window : allWindows) { > if ([window isKeyWindow]) > return window; >@@ -46,14 +48,24 @@ + (WebKitTestRunnerWindow *)_WTR_keyWind > > - (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation > { >+ ASSERT(isMainThread()); > allWindows.append(self); > return [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; > } > >-- (void)dealloc >+- (void)close > { >+ ASSERT(isMainThread()); >+ ASSERT(allWindows.contains(self)); > allWindows.removeFirst(self); > ASSERT(!allWindows.contains(self)); >+ [super close]; >+} >+ >+- (void)dealloc >+{ >+ ASSERT(isMainThread()); >+ 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>). > [super dealloc]; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198422
: 371065