Bug 238070 - [GLIB] Make it possible to call GRefPtr::outPtr() multiple times wihtout an explicit clear
Summary: [GLIB] Make it possible to call GRefPtr::outPtr() multiple times wihtout an e...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, InRadar
Depends on:
Blocks:
 
Reported: 2022-03-18 04:51 PDT by Carlos Garcia Campos
Modified: 2022-03-18 07:20 PDT (History)
13 users (show)

See Also:


Attachments
Patch (11.10 KB, patch)
2022-03-18 04:55 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 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.
Comment 1 Carlos Garcia Campos 2022-03-18 04:55:19 PDT
Created attachment 455086 [details]
Patch
Comment 2 Adrian Perez 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.
Comment 3 Carlos Garcia Campos 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
Comment 4 Adrian Perez 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 :)
Comment 5 Carlos Garcia Campos 2022-03-18 07:19:56 PDT
Committed r291482 (248596@trunk): <https://commits.webkit.org/248596@trunk>
Comment 6 Radar WebKit Bug Importer 2022-03-18 07:20:53 PDT
<rdar://problem/90484376>