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

remove Dispose call on ShellItemRenderer #27890

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void IAppearanceObserver.OnAppearanceChanged(ShellAppearance appearance)
IShellBottomNavViewAppearanceTracker _appearanceTracker;
BottomNavigationViewTracker _bottomNavigationTracker;
BottomSheetDialog _bottomSheetDialog;
bool _disposed;
bool _menuSetup;
ShellAppearance _shellAppearance;
bool _appearanceSet;
Expand Down Expand Up @@ -126,18 +125,6 @@ void Destroy()

}

protected override void Dispose(bool disposing)
{
if (_disposed)
return;

_disposed = true;
if (disposing)
Destroy();

base.Dispose(disposing);
}

// Use OnDestory become OnDestroyView may fire before events are completed.
public override void OnDestroy()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ ShellItem IShellItemRenderer.ShellItem
IShellObservableFragment _currentFragment;
ShellSection _shellSection;
Page _displayedPage;
bool _disposed;

protected ShellItemRendererBase(IShellContext shellContext)
{
Expand Down Expand Up @@ -114,19 +113,6 @@ public override void OnDestroy()
Destroy();
}

protected override void Dispose(bool disposing)
{
if (_disposed)
return;

_disposed = true;

if (disposing)
Destroy();

base.Dispose(disposing);
}

protected abstract ViewGroup GetNavigationTarget();

protected virtual IShellObservableFragment GetOrCreateFragmentForTab(ShellSection shellSection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ protected virtual void SwitchFragment(FragmentManager manager, AView targetView,
// Don't force the commit if this is our first load
if (previousView == null)
{
transaction
.SetReorderingAllowedEx(true);
transaction.SetReorderingAllowedEx(true);
}

transaction.CommitAllowingStateLossEx();
Expand All @@ -245,7 +244,6 @@ void OnDestroyed(object sender, EventArgs args)
{
previousView.Destroyed -= OnDestroyed;

previousView.Dispose();
previousView = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7648,10 +7648,8 @@ override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedCont
override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer.HeaderContainer.Dispose(bool disposing) -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer.HeaderContainer.OnLayout(bool changed, int l, int t, int r, int b) -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer.HeaderContainer.OnMeasure(int widthMeasureSpec, int heightMeasureSpec) -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellItemRenderer.Dispose(bool disposing) -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellItemRenderer.OnDestroy() -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellItemRenderer.OnShellSectionChanged() -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellItemRendererBase.Dispose(bool disposing) -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellItemRendererBase.OnDestroy() -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellSearchView.Dispose(bool disposing) -> void
override Microsoft.Maui.Controls.Platform.Compatibility.ShellSearchView.OnAttachedToWindow() -> void
Expand Down
Loading