Node.js: added reference count increment for the Unit object.

We increase the number to the Unit object so that it lives forever.
This is necessary so that the garbage collector does not delete the Unit object.
This commit is contained in:
Alexander Borisov
2018-11-15 15:24:45 +03:00
parent b033fb329f
commit 71f4cb9134
2 changed files with 13 additions and 0 deletions

View File

@@ -333,6 +333,8 @@ Server.prototype.run_events = function (server, req, res) {
});
Promise.resolve().then(() => {
req.emit("finish");
if (res.finished) {
unit_lib.unit_response_end(res);
}