mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-22 18:49:27 +00:00
Fixed memory leak in taking a screenshot
This commit is contained in:
@@ -75,6 +75,9 @@
|
||||
kCGNullWindowID,
|
||||
kCGWindowImageDefault);
|
||||
BOOL canRecordScreen = !screenshot;
|
||||
if(!canRecordScreen) {
|
||||
CFRelease(screenshot);
|
||||
}
|
||||
if(!canRecordScreen && error) {
|
||||
*error = [NSError errorInDomain:MPAutotypeErrorDomain withCode:MPErrorAutotypeIsMissingScreenRecordingPermissions description:NSLocalizedString(@"ERROR_NO_PERMISSION_TO_RECORD_SCREEN", "Error description for missing screen recording permissions")];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user