In GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL in Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm, the native context is deleted and [WebGLLayer setContext:] called immediately afterward to clear out its NakedPtr<GraphicsContextGLOpenGL>. In order to allow WebGLLayer's cleanup code to potentially do work with the native context, it seems appropriate to release the WebGLLayer earlier. May be related to other recently filed crashes.
Created attachment 395871 [details] Patch
Committed r259764: <https://trac.webkit.org/changeset/259764> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395871 [details].
<rdar://problem/61482594>
Reverted r259764 for reason: Causes layout test crashes under GuardMalloc Committed r259915: <https://trac.webkit.org/changeset/259915>
(In reply to Ryan Haddad from comment #4) > Reverted r259764 for reason: > > Causes layout test crashes under GuardMalloc > > Committed r259915: <https://trac.webkit.org/changeset/259915> We were seeing crashes on iOS Simulator when running tests under GuardMalloc These are some of the tests that hit crashes: fast/canvas/webgl/no-info-log-for-simple-shaders.html fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html webgl/1.0.3/conformance/extensions/ext-blend-minmax.html fast/canvas/webgl/no-info-log-for-simple-shaders.html
Thanks Ryan and sorry about the crashes. Was worried about that. How can I run my local iOS Simulator build with GuardMalloc?
Note - per fix in Bug 210222, if that one lands and sticks, I'll likely close this as WontFix rather than trying to pursue it further.
The fix for Bug 210222 seems that it's stable and won't be reverted, so closing this out as WontFix.