[webkit-dev] Introducing RenderPtr!
Andreas Kling
akling at apple.com
Mon Dec 30 16:17:35 PST 2013
Sup WebKittens,
I’ve just added a “RenderPtr" smart pointer to the rendering code and am in the process of switching code from using raw pointers to this.
Check out the code here: <https://trac.webkit.org/r161115> (note that I’ve since renamed createRenderObject to createRenderer per Antti’s suggestion.)
It’s basically a clone of OwnPtr that destroys the pointee by calling destroy() on it. This is because RenderObjects currently has a virtual willBeDestroyed() that may depend on still being inside the tree when it executes. I’d like to simplify this eventually, and switch over to std::unique_ptr, but that will require some spooky changes to basic tree operations so I’m deferring it for now.
Cheers and happy new year,
Kling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20131231/28865f51/attachment.html>
More information about the webkit-dev
mailing list