RESOLVED FIXED 122945
WebCore::fillWithEmptyClients adopts new empty clients before leaking their pointers
https://bugs.webkit.org/show_bug.cgi?id=122945
Summary WebCore::fillWithEmptyClients adopts new empty clients before leaking their p...
Zan Dobersek
Reported 2013-10-17 00:30:12 PDT
WebCore::fillWithEmptyClients adopts new empty clients before leaking their pointers
Attachments
Patch (2.48 KB, patch)
2013-10-17 00:42 PDT, Zan Dobersek
no flags
Patch (3.19 KB, patch)
2013-10-22 04:07 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2013-10-17 00:42:38 PDT
Anders Carlsson
Comment 2 2013-10-20 12:38:05 PDT
Comment on attachment 214428 [details] Patch These should just use NeverDestroyed instead.
Darin Adler
Comment 3 2013-10-20 19:18:06 PDT
(In reply to comment #2) > These should just use NeverDestroyed instead. So you prefer NeverDestroyed<unique_ptr<X>> to, say, X& for these kinds of globals?
Zan Dobersek
Comment 4 2013-10-21 08:50:48 PDT
(In reply to comment #3) > (In reply to comment #2) > > These should just use NeverDestroyed instead. > > So you prefer NeverDestroyed<unique_ptr<X>> to, say, X& for these kinds of globals? std::unique_ptr isn't that useful (or required) here.
Darin Adler
Comment 5 2013-10-21 09:45:35 PDT
I believe there is an argument in favor of it that Anders may wish to make. I’d like to hear more from him.
Anders Carlsson
Comment 6 2013-10-21 10:07:15 PDT
(In reply to comment #3) > (In reply to comment #2) > > These should just use NeverDestroyed instead. > > So you prefer NeverDestroyed<unique_ptr<X>> to, say, X& for these kinds of globals? No, just NeverDestroyed<X>.
Darin Adler
Comment 7 2013-10-21 11:01:31 PDT
(In reply to comment #6) > No, just NeverDestroyed<X>. Oh, right. Sorry, I guess I overlooked that possibility. Does seem better to avoid the heap memory allocation altogether.
Zan Dobersek
Comment 8 2013-10-22 04:07:31 PDT
Zan Dobersek
Comment 9 2013-10-22 13:15:06 PDT
Comment on attachment 214834 [details] Patch Clearing flags on attachment: 214834 Committed r157807: <http://trac.webkit.org/changeset/157807>
Zan Dobersek
Comment 10 2013-10-22 13:15:14 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.