[Webkit-unassigned] [Bug 184405] New: [WPE][GTK] Remove WlUniquePtr<wl_display> footgun

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 8 18:36:04 PDT 2018


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

            Bug ID: 184405
           Summary: [WPE][GTK] Remove WlUniquePtr<wl_display> footgun
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at igalia.com

WlUniquePtr<wl_display> is a pretty big footgun because there are two different destruction functions -- wl_display_disconnect() and wl_display_destroy() -- and which one you need to use depends on how the wl_display() was created, and WebKit uses both in different places. So WlUniquePtr<wl_display> is pretty unsafe. See bug #176490 for an example of fun caused by using it incorrectly.

Let's use std::unique_ptr with custom deleter functors instead. Suggestions for how to do this better (without giving up RAII) are quite welcome.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180409/1dc44475/attachment-0002.html>


More information about the webkit-unassigned mailing list