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

Fix iOS VideoPlayer memory leak. #7616

Merged
merged 1 commit into from
Aug 5, 2014

Conversation

gin0606
Copy link
Contributor

@gin0606 gin0606 commented Jul 29, 2014

Before

  • MPMoviePlayerController alloc] init~~ -> retain count equal 1.
  • set to strong property -> retain count to 2.
  • set nullptr to self.moviePlayer -> retain count to 1.
  • Leak!

After

  • MPMoviePlayerController alloc] init~~ -> retain count equal 1.
  • call autorelease -> retain count equal 0 when out of autoReleasePool.
  • set to strong property -> retain count to 1.
  • set nullptr to self.moviePlayer -> retain count to 0.
  • MemFree

@WenhaiLin
Copy link
Contributor

@gin0606 You are right.Thank you very much.

@WenhaiLin
Copy link
Contributor

@minggo We should merge this PR.

minggo added a commit that referenced this pull request Aug 5, 2014
@minggo minggo merged commit 007e42f into cocos2d:v3 Aug 5, 2014
@gin0606 gin0606 deleted the fix_videoPlayer_ios_memory_leak branch August 5, 2014 01:31
cocos-travis-mac pushed a commit to cocos-travis-mac/cocos2d-x that referenced this pull request Aug 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants