From 243a4c43847546b0257eecd4f2871ce0ab3eae85 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 25 Sep 2024 21:58:36 -0700 Subject: [PATCH] fix: Properly clean up RCTDevLoadingView on hide --- packages/react-native/React/CoreModules/RCTDevLoadingView.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 0ea90573687e4f..b8880b08952857 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -138,7 +138,7 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo self->_label.font = [UIFont monospacedDigitSystemFontOfSize:12.0 weight:UIFontWeightRegular]; self->_label.textAlignment = NSTextAlignmentCenter; #else // [macOS - self->_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20) + self->_window = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]; @@ -214,6 +214,8 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo }]; #else // [macOS] [RCTKeyWindow() endSheet:self->_window]; + self->_window = nil; + self->_hiding = false; #endif // macOS] }); }