-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix/deprecations memory leak entitlements #2147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
FastestMolasses
merged 5 commits into
CodeEditApp:main
from
vksvicky:fix/deprecations-memory-leak-entitlements
Dec 12, 2025
Merged
Fix/deprecations memory leak entitlements #2147
FastestMolasses
merged 5 commits into
CodeEditApp:main
from
vksvicky:fix/deprecations-memory-leak-entitlements
Dec 12, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resolves build errors with test frameworks (XCTest, Testing) that require macOS 14.0+. This fixes the following linker warnings: - Building for macOS-13.0 but linking with XCTest built for 14.0 - Building for macOS-13.0 but linking with libXCTestSwiftSupport built for 14.0 - Building for macOS-13.0 but linking with Testing framework built for 14.0
- Updated 80+ instances of onChange(of:perform:) to use the new macOS 14.0+ syntax with two-parameter closures (_, newValue in) - Commented out unreachable code in LSPService.swift after early return - Updated Xcode project settings to version 16.1 (LastUpgradeCheck: 2610) - Enabled app sandbox and JIT runtime exceptions for proper execution - Added string catalog symbol generation This resolves all deprecation warnings when targeting macOS 14.0+. Files affected: 39 files Changes: 95 insertions(+), 76 deletions(-)
- Fixed remaining onChange(of:perform:) calls that used explicit 'perform:' label - Updated onChange calls with capture lists to use new two-parameter syntax - Simplified capture list patterns as new onChange provides both old and new values Files fixed: - WorkspacePanelTabBar.swift - EditorTabButtonStyle.swift - EditorTabs.swift (2 instances) - ExtensionsListView.swift All onChange deprecation warnings now resolved.
The app was crashing with REPORT_APP_ENTITLEMENTS_INSUFFICIENT when trying to open file/folder dialogs from the Welcome screen. Added necessary entitlements: - com.apple.security.app-sandbox: Enable App Sandbox - com.apple.security.files.user-selected.read-write: Allow user-selected file access - com.apple.security.files.bookmarks.app-scope: Allow bookmark persistence - com.apple.security.network.client: Enable network access for extensions/LSP This resolves the crash when clicking "Open File or Folder" button.
Fixed memory leak where an UnsafeMutablePointer<passwd> was allocated but never deallocated. Issue Analysis: - Line 43 was allocating heap memory for `result` pointer - getpwuid_r() immediately overwrites `result` to point to `pwd` (stack) - The allocated heap memory was leaked on every call - Attempting to deallocate crashed because `result` pointed to stack memory Root Cause: The allocation was unnecessary. getpwuid_r() expects `result` as an output parameter - it sets the pointer itself, no pre-allocation needed. Solution: Removed the unnecessary .allocate(capacity: 1) call. Now `result` is initialized as nil and getpwuid_r() sets it to point to `pwd` on success. This function is called every time a terminal is opened, so the leak would accumulate with each terminal session.
0xWDG
0xWDG
approved these changes
Dec 8, 2025
FastestMolasses
FastestMolasses
approved these changes
Dec 12, 2025
@FastestMolasses
FastestMolasses
merged commit Dec 12, 2025
78c3be9
into
CodeEditApp:main
1 of 2 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
This PR fixes multiple issues related to macOS 14 compatibility, compiler warnings, and a memory leak.
Description
onChange(of:perform:)deprecation warningsLSPService.swiftCurrentUser.getCurrentUser()Related Issues
#2133
Checklist
Screenshots