-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix NSFileHandleOperationException crash in logger, #3590 #3938
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
Conversation
The commit in the pull request will: - Add a new Lock class - Change Logger to use a lock to coordinate closing of the log file - Change Logger to not use `Utilities` methods that call back into the logger - Change Logger to catch and handle exceptions thrown by file operations - Remove logDirURL from Utilities - Change PrefAdvancedViewController to use Logger.logDirectory instead of Utilities.logDirURL These changes address multiple ways in which the logger can cause IINA to crash.
The new
I corrected the lock property declaration to use
|
The new plugin system is triggering issue #3590, so it is desirable to get this PR reviewed and merged. Another reason to get this merged early is that the new The fix attempts to insure that the logger will never crash IINA. The problems with IINA's termination sequence the original PR attempted to address will be fixed for issue #3939. I'm nearly completion on a fix for that. For the moment I'm turning my attention to other issues now that the plugin system has been merged, but will come back to fixing the termination sequence soon. |
iina/Lock.swift
Outdated
@available(macOS 10.12, *) | ||
private class OSUnfairLockImpl: LockImpl { | ||
|
||
// Use a pointer to insure the lock, which is a struct, is not copied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Use a pointer to insure the lock, which is a struct, is not copied. | |
// Use a pointer to ensure the lock, which is a struct, is not copied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed typo.
iina/Lock.swift
Outdated
} | ||
} | ||
|
||
private class NSLockImpl: LockImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private class NSLockImpl: LockImpl { | |
private struct NSLockImpl: LockImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed.
This commit will: - Change to a struct instead of a class for NSLockImpl - Cleanup code that locates the user's library directory - Correct typo in comment This addresses issues found during review.
The commit in the pull request will:
Utilities
methods that call back into the loggerThese changes address multiple ways in which the logger can cause IINA to crash.
Description:
A new proposed fix for this issue that directly addresses the logger crash.