From 2d8bdb562c9ecd968e11bad73310874ecf5b82ec Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 27 Apr 2024 08:57:55 +0200 Subject: [PATCH] fix(banner, ios): banner not destroyed in new arch --- ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm b/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm index e9661601..1f9c3ffb 100644 --- a/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm +++ b/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm @@ -35,6 +35,11 @@ - (void)prepareForRecycle { [super prepareForRecycle]; static const auto defaultProps = std::make_shared(); _props = defaultProps; + + if (_banner) { + [_banner removeFromSuperview]; + _banner = nil; + } } - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps {