Skip to content

Commit

Permalink
Add hotfix to avoid memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
sefirosweb committed Apr 7, 2024
1 parent 69fec9f commit 8c2b47a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/src/BehaviorModules/BehaviorSleep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ export class BehaviorSleep implements StateBehavior {
/****/

// Pending issue
// https://github.com/PrismarineJS/mineflayer/issues/3349


this.bot.sleep(block)
.catch(err => {
/** HOTFIX until sleep() is fixed **/
console.log('clearing timeout')
.catch(err => {
/** HOTFIX until sleep() is fixed **/
console.log('clearing timeout')
// https://github.com/PrismarineJS/mineflayer/issues/3349
this.bot.removeAllListeners('sleep')
clearTimeout(timeOutForsleep)
/****/

Expand Down

0 comments on commit 8c2b47a

Please sign in to comment.