Commit b72a6b1
authored
fix memory leak
For many reasons, node caches and leaves in memory (for pretty lengthy amount of time) HTTPRequest instances. Form-data doesn't unsubscribe from 'error' and 'response' event, leaving references to finish / callback. This is kind-of okay in most cases (HTTPRequest's do die after a while), it might be a problem with large payloads or other memory-hungry situations.
This was only tested with NodeJS 8 - future versions might change how they are working with HTTPRequest's objects.1 parent cd27e9a commit b72a6b1
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
466 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
467 | 476 | | |
468 | 477 | | |
469 | 478 | | |
| |||
0 commit comments