Skip to content

Commit

Permalink
Reduce memory usage when longStackSupport is disabled
Browse files Browse the repository at this point in the history
mdlavin committed Mar 3, 2016
1 parent 7fb7dad commit ee2b092
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion q.js
Original file line number Diff line number Diff line change
@@ -597,7 +597,12 @@ function defer() {

function become(newPromise) {
resolvedPromise = newPromise;
promise.source = newPromise;

if (Q.longStackSupport && hasStacks) {
// Only hold a reference to the new promise if long stacks
// are enabled to reduce memory usage
promise.source = newPromise;
}

array_reduce(messages, function (undefined, message) {
Q.nextTick(function () {

0 comments on commit ee2b092

Please sign in to comment.