Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not setTimeout if in pretend mode #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afharo
Copy link

@afharo afharo commented Feb 28, 2019

When on pretend mode, it is not clearing the setTimeouts. This change will try to avoid creating them if in pretend mode.

When on pretend mode, it is not clearing the setTimeouts. This change will try to avoid creating them if in pretend mode.
@afharo
Copy link
Author

afharo commented Apr 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant