зеркало из https://github.com/DeGsoft/maui-linux.git
Merge branch '3.6.0' into 4.0.0
This commit is contained in:
Коммит
4356c6736a
|
@ -207,10 +207,13 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && !_disposed)
|
||||
{
|
||||
_disposed = true;
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
_disposed = true;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
if (_tracker != null)
|
||||
{
|
||||
_tracker.Dispose();
|
||||
|
@ -236,7 +239,8 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
|
||||
Device.Info.PropertyChanged -= DeviceInfoPropertyChanged;
|
||||
|
||||
RemoveDrawerListener(this);
|
||||
if (!this.IsDisposed())
|
||||
RemoveDrawerListener(this);
|
||||
|
||||
if (Element != null)
|
||||
{
|
||||
|
|
|
@ -161,10 +161,13 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && !_disposed)
|
||||
{
|
||||
_disposed = true;
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
_disposed = true;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
if (_titleViewRenderer != null)
|
||||
{
|
||||
Android.Platform.ClearRenderer(_titleViewRenderer.View);
|
||||
|
@ -196,7 +199,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
_toolbar = null;
|
||||
}
|
||||
|
||||
if (_drawerLayout != null && _drawerListener != null)
|
||||
if (_drawerLayout.IsAlive() && _drawerListener.IsAlive())
|
||||
{
|
||||
_drawerLayout.RemoveDrawerListener(_drawerListener);
|
||||
}
|
||||
|
|
|
@ -8,5 +8,12 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
return obj.Handle == IntPtr.Zero;
|
||||
}
|
||||
public static bool IsAlive(this Java.Lang.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
return !obj.IsDisposed();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче