Skip to content
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

Xcode reports memory leak in getImageFrom #4412

Closed
1 task done
low-batt opened this issue May 14, 2023 · 1 comment · Fixed by #4413
Closed
1 task done

Xcode reports memory leak in getImageFrom #4412

low-batt opened this issue May 14, 2023 · 1 comment · Fixed by #4413

Comments

@low-batt
Copy link
Contributor

System and IINA version:

  • macOS 13.3.1 (a)
  • IINA 1.3.1

Expected behavior:
In Xcode running Product - Analyze does not detect issues in the code.

Actual behavior:
Xcode detects memory leaks in ObjcUtils.getImageFrom such as this one:

/Users/low-batt/Documents/builds/iina-official/iina/iina/ObjcUtils.m:106:3 Potential leak of an object stored into 'cgImage'

Xcode is correctly detecting a missing call to CGImageRelease.

However, there is no need to correct this code. Commit 3520ac9 changed PlayerCore.screenshotCallback, removing the call to MPVController.getScreenshot, the only code that calls ObjcUtils.getImageFrom. The offending code is no longer used and can be removed.

Steps to reproduce:
In Xcode click on the Analyze menu item under the Product menu.

  • MPV does not have this problem.

How often does this happen?
Every time.

@low-batt low-batt self-assigned this May 14, 2023
low-batt added a commit that referenced this issue May 14, 2023
This commit will:
- Remove the method MPVController.getScreenshot
- Remove the method ObjcUtils.getImageFrom

IINA was not leaking memory. The memory leak Xcode detected was in code
that is no longer used.
uiryuu pushed a commit that referenced this issue May 14, 2023
This commit will:
- Remove the method MPVController.getScreenshot
- Remove the method ObjcUtils.getImageFrom

IINA was not leaking memory. The memory leak Xcode detected was in code
that is no longer used.
@low-batt low-batt linked a pull request May 16, 2023 that will close this issue
2 tasks
@low-batt
Copy link
Contributor Author

Closing as the fix has been merged and this issue is only of interest to developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant