RESOLVED INVALID 17199
ElementRareDataMap should use OwnPtr to avoid any possible leaks
https://bugs.webkit.org/show_bug.cgi?id=17199
Summary ElementRareDataMap should use OwnPtr to avoid any possible leaks
Eric Seidel (no email)
Reported 2008-02-06 13:34:58 PST
ElementRareDataMap should use OwnPtr to avoid any possible leaks Assuming this is safe, typedef HashMap<const Element*, ElementRareData*> ElementRareDataMap; Should be changed to: typedef HashMap<const Element*, OwnPtr<ElementRareData>> ElementRareDataMap; To avoid any possible leaks. Holding new'd objects in raw pointers is dangerous.
Attachments
Adam Roben (:aroben)
Comment 1 2008-02-06 13:42:58 PST
(In reply to comment #0) > ElementRareDataMap should use OwnPtr to avoid any possible leaks > > Assuming this is safe, > typedef HashMap<const Element*, ElementRareData*> ElementRareDataMap; > > Should be changed to: > typedef HashMap<const Element*, OwnPtr<ElementRareData>> ElementRareDataMap; I'm not sure this is possible, since OwnPtr isn't copyable.
Eric Seidel (no email)
Comment 2 2008-02-06 14:07:38 PST
Yeah, I tried. OwnPtr isn't copyable, thus this didn't work. There has to be a solution here though. Maybe auto_ptr? There should be construct we can use to do this safely, and make it *very obvious* when reading the code that the memory management is correct.
Anders Carlsson
Comment 3 2014-01-13 21:56:59 PST
We no longer store rare data in a side table.
Note You need to log in before you can comment on or make changes to this bug.