Bug 238070

Summary: [GLIB] Make it possible to call GRefPtr::outPtr() multiple times wihtout an explicit clear
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, aperez, benjamin, bugs-noreply, calvaris, cdumez, cmarcelo, ews-watchlist, gyuyoung.kim, pnormand, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: Gtk, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=236540
Attachments:
Description Flags
Patch none

Carlos Garcia Campos
Reported 2022-03-18 04:51:46 PDT
Clear the GRefPtr before returning the value in outPtr(), similar to what GUniqueOutPtr does, since it's easy to forget to explicitly call clear from the callers.
Attachments
Patch (11.10 KB, patch)
2022-03-18 04:55 PDT, Carlos Garcia Campos
no flags
Carlos Garcia Campos
Comment 1 2022-03-18 04:55:19 PDT
Adrian Perez
Comment 2 2022-03-18 05:55:26 PDT
Comment on attachment 455086 [details] Patch LGTM, it may make sense to fix the style checker issue while at it.
Carlos Garcia Campos
Comment 3 2022-03-18 05:58:36 PDT
Style failure doesn't matter here, because the file is not the implementation of any class, so there's no header tom include. I think there was a way to workaround it, but I'm not sure it's worth it for a unit test
Adrian Perez
Comment 4 2022-03-18 06:17:46 PDT
(In reply to Carlos Garcia Campos from comment #3) > Style failure doesn't matter here, because the file is not the > implementation of any class, so there's no header tom include. I think there > was a way to workaround it, but I'm not sure it's worth it for a unit test Maybe let's just not mind it, then :)
Carlos Garcia Campos
Comment 5 2022-03-18 07:19:56 PDT
Radar WebKit Bug Importer
Comment 6 2022-03-18 07:20:53 PDT
Note You need to log in before you can comment on or make changes to this bug.