diff --git a/maui/src/Carousel/Platform/PlatformCarousel.cs b/maui/src/Carousel/Platform/PlatformCarousel.cs index 7b150a96..bcf42a88 100644 --- a/maui/src/Carousel/Platform/PlatformCarousel.cs +++ b/maui/src/Carousel/Platform/PlatformCarousel.cs @@ -22,6 +22,31 @@ internal void Connect(ICarousel mauiView) /// internal void Disconnect() { +#if MACCATALYST || IOS + if (_handler != null) + { + if (GestureRecognizer != null) + { + RemoveGestureRecognizer(GestureRecognizer); + } + + foreach (var view in Subviews) + { + if (view is PlatformCarouselItem item) + { + item.InternalCarousel = null; + } + } + + _handler = null; + } +#elif ANDROID + if (carouselHandler != null) + { + carouselHandler = null; + } +#endif + _virtualView = null; }