[Webkit-unassigned] [Bug 157973] PlatformDisplay crash when calling egl_terminate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 1 06:30:07 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=157973

--- Comment #7 from Zan Dobersek <zan at falconsigh.net> ---
Comment on attachment 280228
  --> https://bugs.webkit.org/attachment.cgi?id=280228
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=280228&action=review

>> Source/WebCore/platform/graphics/PlatformDisplay.cpp:171
>> +    std::atexit([] { PlatformDisplay::sharedDisplay().terminateEGLDisplay(); });
> 
> This is harmless, but not really great, since it means terminateEGLDisplay will be redundantly called on the sharedDisplay once for each time initializeEGLDisplay is called on ANY PlatformDisplay object. Perhaps it would it make sense to check if this == PlatformDisplay::sharedDisplay before registering the atexit handler here. Alternatively, and probably better, move this to inside the lambda in PlatformDisplay::sharedDisplay, where it will be called at most once. Or, perhaps the best option is to call terminateEGLDisplay on the current PlatformDisplay (i.e. |this| rather than the sharedDisplay) and remove the call to terminateEGLDisplay from the destructor.

Only PlatformDisplay::sharedDisplay() should ever live during the program lifetime, so this method would only be called only once as well. Asserting !m_eglDisplayInitialized at the beginning here would be helpful in that regard.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160601/4946391f/attachment.html>


More information about the webkit-unassigned mailing list