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

Description Andreas Kling 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();
Comment 1 Andreas Kling 2014-12-05 13:11:58 PST
Created attachment 242652 [details]
Patch
Comment 2 Antti Koivisto 2014-12-05 13:15:25 PST
Comment on attachment 242652 [details]
Patch

Seems like a good idea
Comment 3 Andreas Kling 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>
Comment 4 Andreas Kling 2014-12-05 14:20:21 PST
All reviewed patches have been landed.  Closing bug.