aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live/live-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-17 09:40:45 +0200
committerChocobozzz <me@florianbigard.com>2021-06-17 09:47:41 +0200
commit609a444202b4cf97f962ed596aac4d0d7b7f63fe (patch)
tree7c4c20a24f3172d965aa9a2e102b1aac5491b39c /server/lib/live/live-manager.ts
parentc6406f47500114ef4f215ecf4c641b4f1cc2fb76 (diff)
downloadPeerTube-609a444202b4cf97f962ed596aac4d0d7b7f63fe.tar.gz
PeerTube-609a444202b4cf97f962ed596aac4d0d7b7f63fe.tar.zst
PeerTube-609a444202b4cf97f962ed596aac4d0d7b7f63fe.zip
Fix memory leak
Diffstat (limited to 'server/lib/live/live-manager.ts')
-rw-r--r--server/lib/live/live-manager.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts
index d7199cc89..1863c0b0c 100644
--- a/server/lib/live/live-manager.ts
+++ b/server/lib/live/live-manager.ts
@@ -159,7 +159,12 @@ class LiveManager {
159 } 159 }
160 160
161 const muxingSession = this.muxingSessions.get(sessionId) 161 const muxingSession = this.muxingSessions.get(sessionId)
162 if (muxingSession) muxingSession.abort() 162 if (muxingSession) {
163 muxingSession.abort()
164 muxingSession.destroy()
165
166 this.muxingSessions.delete(sessionId)
167 }
163 } 168 }
164 169
165 private async handleSession (sessionId: string, streamPath: string, streamKey: string) { 170 private async handleSession (sessionId: string, streamPath: string, streamKey: string) {
@@ -269,6 +274,8 @@ class LiveManager {
269 muxingSession.on('after-cleanup', ({ videoId }) => { 274 muxingSession.on('after-cleanup', ({ videoId }) => {
270 this.muxingSessions.delete(sessionId) 275 this.muxingSessions.delete(sessionId)
271 276
277 muxingSession.destroy()
278
272 return this.onAfterMuxingCleanup(videoId) 279 return this.onAfterMuxingCleanup(videoId)
273 .catch(err => logger.error('Error in end transmuxing.', { err, ...localLTags })) 280 .catch(err => logger.error('Error in end transmuxing.', { err, ...localLTags }))
274 }) 281 })