mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
When investigating a memory leak in one of our applications, we discovered that this listener holds on to a `REPLServer` instance and all heap objects transitively kept alive by it by capturing as part of its closure. It's cleaner to declare the listener outside of the `REPLServer` class and to actually clean it up properly when it is no longer required or meaningful, which is easily achieved through keeping a reference count. PR-URL: https://github.com/nodejs/node/pull/61895 Backport-PR-URL: https://github.com/nodejs/node/pull/63194 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>