Repository: electron
Issue: WebFrameMain frames and name field access SIGSEGV
Labels: platform/macOS,bug :beetle:,33-x-y

### Preflight Checklist

- [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [x] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

33.3.0

### What operating system(s) are you using?

macOS

### Operating System Version

macOS Sonoma 14.3

### What arch are you using?

arm64 (including Apple Silicon)

### Last Known Working Electron version

_No response_

### Expected Behavior

Accessing WebFrameMain `frames` and `name` attributes on destroyed frames previously threw an error.

### Actual Behavior

Accessing WebFrameMain `frames` and `name` attributes on destroyed frames now segfaults.

```checked if frame is alive 0.8441429125447275
checking if frame is alive 0.7526827941185381
checked if frame is destroyed 0.7526827941185381
checking if frame is detached 0.7526827941185381
checked if frame is detached 0.7526827941185381
checking .frames 0.7526827941185381
.../app/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGSEGV```

The trace:

```
Thread 0 (crashed)
0 Electron Framework!content::FrameTree::SubtreeAndInnerTreeNodes(content::RenderFrameHostImpl*, bool) [frame_tree.cc : 353 + 0x0]
x0 = 0xefefefefefefefef x1 = 0x0000000000000000
x2 = 0x000000010c47eb00 x3 = 0x0000000000000000
x4 = 0x0000000000000000 x5 = 0x000000000000000f
x6 = 0x0000000000000180 x7 = 0x0000000000000004
x8 = 0xaaaaaaaaaaaaaaaa x9 = 0x000000010eb2cd94
x10 = 0xffffffffffff1e48  x11 = 0x00000d6300100000
x12 = 0x0000000000001685  x13 = 0x0000000000000044
x14 = 0x0000000000000010  x15 = 0x0000000000000003
x16 = 0x000000000089cb29  x17 = 0x0000000157e0f6cc
x18 = 0x0000000000000000  x19 = 0x000000016d59b710
x20 = 0x0000000000000000  x21 = 0x00000104009d7e00
x22 = 0x0000000000000000  x23 = 0x000000011528a000
x24 = 0x00000001153b8000  x25 = 0xefefefefefefefef
x26 = 0x0000010400510100  x27 = 0x00000d63002cdf65
x28 = 0x00000d6300000000 fp = 0x000000016d59b680
lr = 0x000000010eaf767c sp = 0x000000016d59b600
pc = 0x000000010ea57460
Found by: given as instruction pointer in context
1 Electron Framework!content::RenderFrameHostImpl::ForEachRenderFrameHostImpl(base::FunctionRef&lt;content::RenderFrameHost::FrameIterationAction (content::RenderFrameHostImpl*)&gt;, bool) [render_frame_host_impl.cc : 2713 + 0xc]
x19 = 0x0000000000000000  x20 = 0x000000010eb2cd9c
x21 = 0x000000016d59b790  x22 = 0x00000104009d7e00
x23 = 0xaaaaaaaaaaaaaaaa  x24 = 0x00000001153b8000
x25 = 0x00000104000f0280  x26 = 0x0000010400510100
x27 = 0x00000d63002cdf65  x28 = 0x00000d6300000000
fp = 0x000000016d59b770 sp = 0x000000016d59b690
pc = 0x000000010eaf767c
Found by: call frame info
2 Electron Framework!content::RenderFrameHostImpl::ForEachRenderFrameHost(base::FunctionRef&lt;void (content::RenderFrameHost*)&gt;) [render_frame_host_impl.cc : 2638 + 0x8]
x19 = 0x00000104067ccfa0  x20 = 0x000000016d59b7e8
x21 = 0x000000016d59b8a8  x22 = 0x0000000000000001
x23 = 0x0000000000000015  x24 = 0x00000001153b8000
x25 = 0x00000104000f0280  x26 = 0x0000010400510100
x27 = 0x00000d63002cdf65  x28 = 0x00000d6300000000
fp = 0x000000016d59b7a0 sp = 0x000000016d59b780
pc = 0x000000010eaf75c0
Found by: call frame info
3 Electron Framework!electron::api::WebFrameMain::Frames() const [electron_api_web_frame_main.cc : 412 + 0x4]
x19 = 0x00000104067ccfa0  x20 = 0x000000016d59b7e8
x21 = 0x000000016d59b8a8  x22 = 0x0000000000000001
x23 = 0x0000000000000015  x24 = 0x00000001153b8000
x25 = 0x00000104000f0280  x26 = 0x0000010400510100
x27 = 0x00000d63002cdf65  x28 = 0x00000d6300000000
fp = 0x000000016d59b7d0 sp = 0x000000016d59b7b0
pc = 0x000000010c47bf8c
Found by: call frame info```

### Testcase Gist URL

_No response_

### Additional Information

This may be related to [#43473](https://github.com/electron/electron/pull/43473) @samuelmaddock