Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Avoid load icon if menu item is disposed #8280

Merged
merged 3 commits into from
Jun 24, 2022
Merged

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Avoid load icon if menu item is disposed on Android.

Issues Fixed

Fixes #8101

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/android 🤖 area-controls-shell Shell Navigation, Routes, Tabs, Flyout fatal labels Jun 23, 2022
@PureWeen PureWeen changed the base branch from main to net6.0 June 23, 2022 19:36
if (result is not null)
menuItem?.SetIcon(result.Value);
if (menuItem.IsAlive() && result is not null)
menuItem.SetIcon(result.Value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the check here @jsuarezruiz

According to the exception the call fails here
at AndroidX.AppCompat.View.Menu.MenuItemImpl.SetIcon

Which makes sense because this is happening after the async/await so the menuItem has become disposed at that point

@PureWeen PureWeen merged commit 2182949 into net6.0 Jun 24, 2022
@PureWeen PureWeen deleted the fix-8101 branch June 24, 2022 19:01
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2023
@samhouts samhouts added the fixed-in-6.0.408 Look for this fix in 6.0.408! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout fixed-in-6.0.408 Look for this fix in 6.0.408! platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] ObjectDisposedException 'AndroidX.AppCompat.View.Menu.MenuItemImpl' Modifying Shell Items
3 participants