Skip to content

Commit 62f66e6

Browse files
authored
Fix a crash when closing the app when running (#269)
1 parent d2e9d97 commit 62f66e6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/SkiaSharp.Extended.UI/Controls/SKAnimatedSurfaceView.shared.cs

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ private void UpdateIsAnimationEnabled()
8282
if (!weakThis.TryGetTarget(out var strongThis))
8383
return false;
8484

85+
#if !XAMARIN_FORMS
86+
if (strongThis.Window is null)
87+
return false;
88+
#endif
89+
90+
if (!strongThis.IsLoadedEx())
91+
return false;
92+
8593
strongThis.Invalidate();
8694

8795
return strongThis.IsAnimationEnabled;

0 commit comments

Comments
 (0)