-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: memory leak and string corruption in ARM Mac temperature sensors
This commit addresses several issues in the temperature sensor implementation for ARM Mac: 1. Memory leak caused by unreleased system resources 2. Increasing port counts in Activity Monitor 3. String corruption where the first character becomes "\x00" Changes: 1. Resource Management: - Added proper resource cleanup using `defer` statements - Refactored code to share the HID system client instead of creating new ones - Fixed memory leaks by ensuring all CoreFoundation objects are properly released 2. String Handling: - Fixed buffer allocation for string conversion - Properly handle null terminators in C string to Go string conversion - Added correct string length calculations 3. Code Structure: - Reduced resource allocation by sharing system client between functions - Enhanced code readability with better comments
- Loading branch information
Showing
1 changed file
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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