Bug 139309

Summary: PassRef should deref on destruction if pointee was not moved.
Product: WebKit Reporter: Andreas Kling <kling>
Component: Tools / TestsAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue, esprehn+autocc, glenn, kling, kondapallykalyan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Andreas Kling
Reported 2014-12-05 13:06:30 PST
Instead of having PassRef be a footgun, let's just make it deref() the pointee in ~PassRef if the object was not WTF::move()'d. This will make PassRef usable for all ::create style functions and enable idioms like Foo::create().get().doStuff();
Attachments
Patch (6.54 KB, patch)
2014-12-05 13:11 PST, Andreas Kling
no flags
Andreas Kling
Comment 1 2014-12-05 13:11:58 PST
Antti Koivisto
Comment 2 2014-12-05 13:15:25 PST
Comment on attachment 242652 [details] Patch Seems like a good idea
Andreas Kling
Comment 3 2014-12-05 14:20:16 PST
Comment on attachment 242652 [details] Patch Clearing flags on attachment: 242652 Committed r176873: <http://trac.webkit.org/changeset/176873>
Andreas Kling
Comment 4 2014-12-05 14:20:21 PST
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.