mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-15 03:57:22 +00:00
fix(memleak): temp, wonky fix to #4079 . Sets closure vars user to
null in api.batchUpdate(). More will be needed
This commit is contained in:
parent
bf662ff119
commit
ead42e7cef
1 changed files with 5 additions and 2 deletions
|
|
@ -444,14 +444,17 @@ api.batchUpdate = function(req, res, next) {
|
|||
});
|
||||
|
||||
// call all the operations, then return the user object to the requester
|
||||
async.waterfall(ops, function(err,user) {
|
||||
async.waterfall(ops, function(err,_user) {
|
||||
res.json = oldJson;
|
||||
res.send = oldSend;
|
||||
if (err) return next(err);
|
||||
|
||||
var response = user.toJSON();
|
||||
var response = _user.toJSON();
|
||||
response.wasModified = res.locals.wasModified;
|
||||
|
||||
user.fns.nullify();
|
||||
user = res.locals.user = oldSend = oldJson = oldSave = null;
|
||||
|
||||
// return only drops & streaks
|
||||
if (response._tmp && response._tmp.drop){
|
||||
res.json(200, {_tmp: {drop: response._tmp.drop}, _v: response._v});
|
||||
|
|
|
|||
Loading…
Reference in a new issue