Jeff-Lewis / cls-hooked

cls-hooked : CLS using AsynWrap or async_hooks instead of async-listener for node 4.7+
BSD 2-Clause "Simplified" License
758 stars 89 forks source link

Fixed: runPromise memory leak #72

Closed eliabecardoso closed 2 years ago

eliabecardoso commented 2 years ago

This PR is fixing memory leak and incorrect propagation of the runPromise method. The exit method was being called after the promise was resolved/rejected, it looks like it was not clearing the active property in time for the next createContext called on the next runPromise.

Issues: #63 and #71

No side effects occured after this fix.

Tests:

  1. Before fix: before-runpromise

  2. After fix: after-runpromise

  3. Correct propagation: after-runpromise-no-side-effect