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

[expo-av] Fix mem-leak when unmounting Video component #9379

Merged
merged 3 commits into from
Jul 24, 2020

Conversation

IjzerenHein
Copy link
Contributor

Why

Unmounting a <Video> component causes a memory leak on iOS because EXVideoView is not deallocated from memory.

How

EXVideoView registered a listener with EXAV which kept a strong reference to the View causing it to never be de-allocated.

  • Update EXAV VideoForAudioLifecycle listener to use weak-reference NSHashTable instead
  • Remove unused NSNotificationCenter observers from EXVideoView

Test Plan

  • Before, dealloc was not called
  • After, dealloc is called and listener is unregister as expected

image

@github-actions
Copy link
Contributor

Native Component List for this branch is ready

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

Successfully merging this pull request may close these issues.

None yet

1 participant