SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 151 C++

Remove makeKeyWindow call in RCTLogBoxView dealloc (#56861)

Summary:
This pull request makes a minor cleanup to the [RCTLogBoxView.mm](vscode-file://vscode-app/c:/Users/agloryvimalabai/AppData/Local/Programs/Microsoft%20VS%20Code/0958016b2a/resources/app/out/vs/code/electron-browser/workbench/workbench.html) file by removing code in the dealloc method that referenced the application delegate and window. This change eliminates unnecessary code, particularly for Mac Catalyst targets.

Removed the call to [RCTSharedApplication().delegate.window makeKeyWindow] in the dealloc method, cleaning up platform-specific code and improving maintainability. The conditional block (including the Mac Catalyst guard) is deleted, leaving the dealloc implementation empty and removing window manipulation at teardown.
Summary
Removes unsafe window manipulation from [RCTLogBoxView](vscode-file://vscode-app/c:/Users/agloryvimalabai/AppData/Local/Programs/Microsoft%20VS%20Code/0958016b2a/resources/app/out/vs/code/electron-browser/workbench/workbench.html)’s dealloc method. This prevents a crash when using SceneDelegate, as [AppDelegate.window](vscode-file://vscode-app/c:/Users/agloryvimalabai/AppData/Local/Programs/Microsoft%20VS%20Code/0958016b2a/resources/app/out/vs/code/electron-browser/workbench/workbench.html) may not exist in modern iOS app setups.

Changelog:
[iOS] [Fixed] - Remove unsafe window manipulation in [RCTLogBoxView](vscode-file://vscode-app/c:/Users/agloryvimalabai/AppData/Local/Programs/Microsoft%20VS%20Code/0958016b2a/resources/app/out/vs/code/electron-browser/workbench/workbench.html) dealloc to prevent crash with SceneDelegate

Pull Request resolved: https://github.com/facebook/react-native/pull/56861

Test Plan:
Verified that the app no longer crashes on teardown when using SceneDelegate.
Ran the full test suite; no regressions related to LogBox or RCTLogBoxView.
Manual test: Opened and dismissed LogBox in a SceneDelegate-based app without crash.
This pull request includes a small change to the [RCTLogBoxView.mm](vscode-file://vscode-app/c:/Users/agloryvimalabai/AppData/Local/Programs/Microsoft%20VS%20Code/0958016b2a/resources/app/out/vs/code/electron-browser/workbench/workbench.html) file, specifically in the dealloc method. The code that previously made the main window key again on deallocation (except for Mac Catalyst) has been removed, simplifying the cleanup logic.

Updated todo list

GPT-4.1 • 0x

Reviewed By: javache

Differential Revision: D105582862

Pulled By: cipolleschi

fbshipit-source-id: 420909ee347be6f7050688a615af13e36bf8b00f
A
Aswin Andro committed
4f825d346924f71d80c98f4b7ba260f55ac06f52
Parent: bd93817
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 5/19/2026, 10:22:26 AM