Summary: | Simplify DOM wrapper destruction, don't deref() in finalizers. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||
Component: | WebCore JavaScript | Assignee: | Andreas Kling <kling> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, ggaren | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Andreas Kling
2015-04-24 21:13:05 PDT
Created attachment 251609 [details]
Proposed patch
Comment on attachment 251609 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=251609&action=review > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1089 > + push(@headerContent, " void releaseImpl() { m_impl->deref(); m_impl = nullptr; }\n\n"); Could consider the suggestion Oliver Hunt made for the smart pointer classes: void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); } That would mean that m_impl would be null if something happened to run in the destructor and turn around and see this object. Created attachment 251899 [details]
Patch for landing
With std::exchange like darin suggested.
Comment on attachment 251899 [details]
Patch for landing
Holding cq+ while I check on a potential issue locally.
Comment on attachment 251899 [details]
Patch for landing
Local issue was something else entirely. Resuming commit queue.
Comment on attachment 251899 [details] Patch for landing Clearing flags on attachment: 251899 Committed r183523: <http://trac.webkit.org/changeset/183523> All reviewed patches have been landed. Closing bug. |