Commit 863aa22c authored by Steven Allen's avatar Steven Allen

sessions: fix a small memory leak

parent 7944a99c
......@@ -100,6 +100,7 @@ func (sm *SessionManager) removeSession(session sesTrk) {
for i := 0; i < len(sm.sessions); i++ {
if sm.sessions[i] == session {
sm.sessions[i] = sm.sessions[len(sm.sessions)-1]
sm.sessions[len(sm.sessions)-1] = sesTrk{} // free memory.
sm.sessions = sm.sessions[:len(sm.sessions)-1]
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment