Skip to content

Commit

Permalink
remove Dispose call on ShellItemRenderer (#27890)
Browse files Browse the repository at this point in the history
* remove Dispose call on ShellItemRenderer

* update publicAPI txt
  • Loading branch information
pictos authored Feb 25, 2025
1 parent 34f877e commit d009291
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 32 deletions.
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

0 comments on commit d009291

Please sign in to comment.