Skip to content

Commit

Permalink
fix(play): purge event listeners (memory optimization)
Browse files Browse the repository at this point in the history
  • Loading branch information
eritislami committed Sep 3, 2021
1 parent 01c2faa commit 4ad97d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ module.exports = {
.on("finish", () => {
if (collector && !collector.ended) collector.stop();

queue.connection.removeAllListeners("disconnect");

if (queue.loop) {
// if loop is on, push the song back at the end of the queue
// so it can repeat endlessly
Expand Down

0 comments on commit 4ad97d2

Please sign in to comment.