Skip to content

Commit

Permalink
Fix for a typo that causes a memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris-van-der-Wel committed Dec 15, 2014
1 parent 1e4ff7c commit 45c7cf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/client/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ Doc.prototype._otApply = function(opData, context) {
if (c != context && c._onOp) c._onOp(opData.op);
}
for (var i = 0; i < contexts.length; i++) {
if (contexts.remove) contexts.splice(i--, 1);
if (contexts[i].remove) contexts.splice(i--, 1);
}

return this.emit('after op', opData.op, context);
Expand Down

2 comments on commit 45c7cf6

@jclem
Copy link

@jclem jclem commented on 45c7cf6 Jun 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the OT APIs have a remove method on them. Won't this remove any context that has that method mixed in from here, for example?

@pedrosanta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem like it's removing them, yes. Follow up discussion at #380.

Please sign in to comment.