Refactored touchID codebase to be more in line with the rest.

Fixed a lot of potential memory leaks
Fixed all issues reported analyzer
This commit is contained in:
Michael Starke
2022-08-30 13:13:12 +02:00
parent 0af2a2258f
commit d601d6ed3f
20 changed files with 329 additions and 229 deletions

View File

@@ -219,7 +219,8 @@ static MPAutotypeDaemon *_sharedInstance;
NSNotificationCenter * __weak nc = [NSNotificationCenter defaultCenter];
MPAutotypeDaemon * __weak welf = self;
NSTimeInterval requestTime = NSDate.date.timeIntervalSinceReferenceDate;
id __block unlockToken = [nc addObserverForName:MPDocumentDidUnlockDatabaseNotification
id __block unlockToken; // silence init value never read analyzer warning
unlockToken = [nc addObserverForName:MPDocumentDidUnlockDatabaseNotification
object:nil
queue:NSOperationQueue.mainQueue
usingBlock:^(NSNotification *notification) {
@@ -247,7 +248,8 @@ static MPAutotypeDaemon *_sharedInstance;
NSNotificationCenter * __weak nc = [NSNotificationCenter defaultCenter];
MPAutotypeDaemon * __weak welf = self;
NSTimeInterval requestTime = NSDate.date.timeIntervalSinceReferenceDate;
id __block unlockToken = [nc addObserverForName:MPDocumentDidUnlockDatabaseNotification
id __block unlockToken; // silence init value never read analyzer warning
unlockToken = [nc addObserverForName:MPDocumentDidUnlockDatabaseNotification
object:nil
queue:NSOperationQueue.mainQueue
usingBlock:^(NSNotification *notification) {
@@ -408,7 +410,8 @@ static MPAutotypeDaemon *_sharedInstance;
}
NSNotificationCenter * __weak nc = NSWorkspace.sharedWorkspace.notificationCenter;
id __block didActivateToken = [nc addObserverForName:NSWorkspaceDidActivateApplicationNotification
id __block didActivateToken; // silence init value never read analyzer warning
didActivateToken = [nc addObserverForName:NSWorkspaceDidActivateApplicationNotification
object:nil
queue:NSOperationQueue.mainQueue
usingBlock:^(NSNotification *notification) {