Open afharo opened 5 years ago
Hello!
Can anyone review this PR? It is causing an important memory leak because it's allocating timeouts and never clearing them when using them in pretend
mode.
I use this to help me with the logging of my API requests, but using other libraries to perform the actual request. So the only use I make of this library is pretend
only. For every single call, it's allocating a timeout that won't be cleared until it fires off. Also calling the callback twice (once for the successful logging + a second time when the timeout fires off), not allowing the Garbage Collector to clear my callback code either.
When on pretend mode, it is not clearing the setTimeouts. This change will try to avoid creating them if in pretend mode.