Repository: vscode
Issue: Crash when exit with floating windows
Labels: bug,upstream,freeze-slow-crash-leak,macos,electron,confirmed,workbench-auxwindow

Steps to Reproduce:

1.  running out of sources (macOS ARM)
2. open a workspace and some editors
3. drag an editor out to have a floating window
4. right click on dock
5. select `Quit`

Crash:

```
Process:               Electron [60499]
Path:                  /Users/USER/*/Code - OSS.app/Contents/MacOS/Electron
Identifier:            com.visualstudio.code.oss
Version:               1.86.0 (1.86.0)
Code Type:             ARM-64 (Native)
Parent Process:        zsh [58362]
Responsible:           Terminal [58360]
User ID:               501

Date/Time:             2024-01-03 06:51:25.9211 +0100
OS Version:            macOS 14.2.1 (23C71)
Report Version:        12
Anonymous UUID:        788776C6-C6DE-6D76-2B58-BFAD9D23AEE4

Sleep/Wake UUID:       3F97468E-7147-44BD-A00D-952C69E08DB3

Time Awake Since Boot: 100000 seconds
Time Since Wake:       1736 seconds

System Integrity Protection: enabled

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Codes:       0x0000000000000001, 0x0000000000000010

VM Region Info: 0x10 is not in any region.  Bytes before following region: 4365484016
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      104340000-104344000    [   16K] r-x/r-x SM=COW  ...acOS/Electron

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	       0x18db21420 objc_msgSend + 32
1   Electron Framework            	       0x10f78ccc8 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 12769324
2   Electron Framework            	       0x10f78c7c0 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 12768036
3   Electron Framework            	       0x10ce68a84 v8::CodeEvent::GetScriptName() + 6348
4   AppKit                        	       0x191adc5e4 -[NSApplication _terminateFromSender:askIfShouldTerminate:saveWindows:] + 124
5   AppKit                        	       0x191adc4dc __52-[NSApplication(NSAppleEventHandling) _handleAEQuit]_block_invoke + 52
6   AppKit                        	       0x191be1764 ___NSMainRunLoopPerformBlockInModes_block_invoke + 44
7   CoreFoundation                	       0x18dfcb5e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
8   CoreFoundation                	       0x18dfcb4f8 __CFRunLoopDoBlocks + 356
9   CoreFoundation                	       0x18dfca330 __CFRunLoopRun + 812
10  CoreFoundation                	       0x18dfc99ac CFRunLoopRunSpecific + 608
11  HIToolbox                     	       0x198578448 RunCurrentEventLoopInMode + 292
12  HIToolbox                     	       0x1985780d8 ReceiveNextEventCommon + 220
13  HIToolbox                     	       0x198577fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
14  AppKit                        	       0x1917a68a4 _DPSNextEvent + 660
15  AppKit                        	       0x191f80980 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
16  AppKit                        	       0x191799d50 -[NSApplication run] + 476
17  Electron Framework            	       0x10fa34cf4 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 15554648
18  Electron Framework            	       0x10fa32d44 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 15546536
19  Electron Framework            	       0x10f9ec774 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 15258328
20  Electron Framework            	       0x10f9b6a98 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 15037948
21  Electron Framework            	       0x10ec9ee70 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 1309140
22  Electron Framework            	       0x10eca0900 v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 1315940
23  Electron Framework            	       0x10ec9c86c v8::internal::SetupIsolateDelegate::SetupBuiltins(v8::internal::Isolate*, bool) + 1299408
24  Electron Framework            	       0x10d014044 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 14176
25  Electron Framework            	       0x10d015180 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 18588
26  Electron Framework            	       0x10d014ff4 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 18192
27  Electron Framework            	       0x10d0137f4 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 12048
28  Electron Framework            	       0x10d0139fc v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 12568
29  Electron Framework            	       0x10cd0c658 ElectronMain + 128
30  dyld                          	       0x18db6d0e0 start + 2360
```