Bug 236998

Summary: NSSharingServicePicker gets deallocated when using the standard share menu item
Product: WebKit Reporter: Kate Cheney <katherine_cheney>
Component: New BugsAssignee: Kate Cheney <katherine_cheney>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, hi, megan_gardner, thorton, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Kate Cheney 2022-02-21 15:11:55 PST
NSSharingServicePicker gets deallocated when using the standard share menu item
Comment 1 Kate Cheney 2022-02-21 15:12:58 PST
Created attachment 452782 [details]
Patch
Comment 2 Kate Cheney 2022-02-21 15:13:24 PST
rdar://89174827
Comment 3 Wenson Hsieh 2022-02-21 15:43:44 PST
Comment on attachment 452782 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=452782&action=review

> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:419
> +        [shareMenuItem setRepresentedObject:sharingServicePicker.get()];

Do we need to also unset this at some point in time? (Or does it clean up when the menu is done presenting?)
Comment 4 Kate Cheney 2022-02-21 16:04:09 PST
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 452782 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=452782&action=review
> 
> > Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:419
> > +        [shareMenuItem setRepresentedObject:sharingServicePicker.get()];
> 
> Do we need to also unset this at some point in time? (Or does it clean up
> when the menu is done presenting?)

We should not need to unset it, AFAICT we only use it to keep the picker alive as long as the NSMenuItem is alive.
Comment 5 EWS 2022-02-22 01:07:12 PST
Committed r290292 (247616@main): <https://commits.webkit.org/247616@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 452782 [details].