CodeEdit
CodeEdit copied to clipboard
🐞 Crash on opening empty file
Description
When opening empty file or delete all content, App gets crashed.
To Reproduce
- Open any file
- CMD+A
- Delete
Expected behavior
All the text is deleted, and App is not crashed.
Version information
CodeEdit: [e.g. 1.0] macOS: [e.g. 12.3] Xcode: [e.g. 13.2]
Additional context
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libswiftCore.dylib 0x1ac3f08d8 swift::runtime::AccessSet::insert(swift::runtime::Access*, void*, void*, swift::ExclusivityFlags) + 60
1 libswiftCore.dylib 0x1ac3f0b18 swift_beginAccess + 84
2 libswiftCore.dylib 0x1ac3f0b18 swift_beginAccess + 84
3 SwiftUI 0x1c4a1db34 LayoutComputer.EngineDelegate.spacing() + 32
4 SwiftUI 0x1c4b173d0 InsetViewLayout.spacing() + 272
5 SwiftUI 0x1c4b17f28 InsetViewLayout.sizeThatFits(_:) + 92
6 SwiftUI 0x1c4b187e0 closure #1 in closure #1 in InsetLayoutComputer.Engine.sizeThatFits(_:) + 76
7 AttributeGraph 0x1c5500a3c AG::Graph::with_update(AG::data::ptr<AG::Node>, AG::ClosureFunctionVV<void>) + 268
8 SwiftUI 0x1c4b186cc InsetLayoutComputer.Engine.sizeThatFits(_:) + 356
9 SwiftUI 0x1c4a1dbcc LayoutComputer.EngineDelegate.sizeThatFits(_:) + 100
10 SwiftUI 0x1c4789f0c ViewGraph.sizeThatFits(_:) + 256
11 SwiftUI 0x1c5089870 closure #1 in ViewRendererHost.sizeThatFits(_:) + 52
12 SwiftUI 0x1c5082bfc closure #1 in ViewRendererHost.updateViewGraph<A>(body:) + 108
13 SwiftUI 0x1c50818e8 ViewRendererHost.updateViewGraph<A>(body:) + 84
14 SwiftUI 0x1c5075988 ViewRendererHost.sizeThatFits(_:) + 120
15 SwiftUI 0x1c50d1360 NSHostingView.minSize() + 80
16 SwiftUI 0x1c50d71a0 NSHostingView.SizeConstraints.update(from:) + 212
17 SwiftUI 0x1c50d7c78 NSHostingView._willUpdateConstraintsForSubtree() + 260
18 SwiftUI 0x1c50d7de8 @objc NSHostingView._willUpdateConstraintsForSubtree() + 28
19 AppKit 0x1a1bcaac4 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 96
20 AppKit 0x1a1bcac00 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 412
21 AppKit 0x1a1bcac00 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 412
22 AppKit 0x1a1bcac00 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 412
23 AppKit 0x1a1bcac00 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 412
24 AppKit 0x1a1bd9ca0 __82-[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:]_block_invoke + 264
25 CoreAutoLayout 0x1a647409c -[NSISEngine withBehaviors:performModifications:] + 88
26 AppKit 0x1a1bcab48 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 228
27 AppKit 0x1a1bca950 __45-[NSView updateConstraintsForSubtreeIfNeeded]_block_invoke + 64
28 CoreAutoLayout 0x1a647409c -[NSISEngine withBehaviors:performModifications:] + 88
29 AppKit 0x1a1b3e36c -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 64
30 AppKit 0x1a1bca740 -[NSView updateConstraintsForSubtreeIfNeeded] + 252
31 CoreAutoLayout 0x1a647409c -[NSISEngine withBehaviors:performModifications:] + 88
32 AppKit 0x1a1b3e36c -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 64
33 AppKit 0x1a1bf3a28 -[NSWindow(NSConstraintBasedLayout) updateConstraintsIfNeeded] + 224
34 AppKit 0x1a1bf387c __NSWindowGetDisplayCycleObserverForUpdateConstraints_block_invoke + 436
35 AppKit 0x1a1bf367c NSDisplayCycleObserverInvoke + 188
36 AppKit 0x1a1bf3208 NSDisplayCycleFlush + 820
37 QuartzCore 0x1a5e3c3ec CA::Transaction::run_commit_handlers(CATransactionPhase) + 120
38 QuartzCore 0x1a5e3b354 CA::Transaction::commit() + 328
39 AppKit 0x1a1c9169c __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 304
40 AppKit 0x1a23f6758 ___NSRunLoopObserverCreateWithHandler_block_invoke + 64
41 CoreFoundation 0x19efc01a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
42 CoreFoundation 0x19efbfff4 __CFRunLoopDoObservers + 592
43 CoreFoundation 0x19efbf528 __CFRunLoopRun + 772
44 CoreFoundation 0x19efbea84 CFRunLoopRunSpecific + 600
45 HIToolbox 0x1a7bfe338 RunCurrentEventLoopInMode + 292
46 HIToolbox 0x1a7bfdfc4 ReceiveNextEventCommon + 324
47 HIToolbox 0x1a7bfde68 _BlockUntilNextEventMatchingListInModeWithFilter + 72
48 AppKit 0x1a1b2651c _DPSNextEvent + 860
49 AppKit 0x1a1b24e14 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328
50 AppKit 0x1a1b16fe0 -[NSApplication run] + 596
51 AppKit 0x1a1ae86fc NSApplicationMain + 1132
52 CodeEdit 0x1048e58cc main + 12 (AppDelegate.swift:33)
53 dyld 0x1083e108c start + 520
Can you try again on the latest release? I cannot reproduce this anymore.
Closing as I cannot reproduce either.
sorry for the slow response, the latest code works, thank you!