[Webkit-unassigned] [Bug 180232] New: Remove virtual function calls in GraphicsLayer destructors

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 30 19:06:23 PST 2017


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

            Bug ID: 180232
           Summary: Remove virtual function calls in GraphicsLayer
                    destructors
           Product: WebKit
           Version: Other
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at igalia.com
                CC: bugs-noreply at webkitgtk.org

I notice that ~CoordinatedGraphicsLayer makes a virtual function call to GraphicsLayer::willBeDestroyed, which makes a virtual function call to CoordinatedGraphicsLayer::removeFromParent. I think that the functions are being called as intended, because ~CoordinatedGraphicsLayer has not yet been fully destroyed. However, I'm reminded of Effective C++ item #9: Never call virtual functions during construction or destruction ("because such calls will never go to a more derived class than that of the currently executing constructor or destructor"). This code is almost certain to break if anyone tries in the future to subclass any of the existing subclasses of GraphicsLayer, so let's refactor it a bit.

I'm a bit nervous touching this code, but I think my changes are safe.

-- 
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/20171201/9e2d8918/attachment-0001.html>


More information about the webkit-unassigned mailing list