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 Memory leak #160

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Fix Memory leak #160

merged 1 commit into from
Apr 8, 2021

Conversation

onthegit
Copy link

@onthegit onthegit commented Feb 22, 2021

I tested livego continuously and the memory kept increasing, suggesting there was memory leak somewhere. The culprit was the stream not being deleted.

When the pushing ends s.isStart is set to false, which prevents the stream from being deleted, when CheckAlive()

func (s *Stream) CheckAlive() (n int) {

is called. Specifically:

if !v.w.Alive() && s.isStart {

I also added writerClosed to flvWriter to prevent closing it twice.

@matthewgao matthewgao merged commit 3486323 into gwuhaolin:master Apr 8, 2021
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.

2 participants