Bug 236998 - NSSharingServicePicker gets deallocated when using the standard share menu item
Summary: NSSharingServicePicker gets deallocated when using the standard share menu item
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-21 15:11 PST by Kate Cheney
Modified: 2022-02-22 01:07 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.69 KB, patch)
2022-02-21 15:12 PST, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].