Skip to content
This repository
Browse code

Fix for unhandled weak garbage collection

The callbacks in proto were only getting culled after garbage collection on the client side. On the server side callbacks were getting gc'd without updating proto via cull causing responses to vanish.
  • Loading branch information...
commit a8d1e264ff17d7280a82ca2fef58a7f6eddd8873 1 parent 3aed873
jscharlach jscharlach authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  index.js
3  index.js
@@ -26,8 +26,9 @@ function D (cons, opts) {
26 26 if (opts.weak !== false && !opts.proto) {
27 27 opts.proto = {};
28 28 opts.proto.wrap = function (cb, id) {
  29 + var proto = this;
29 30 return weak(cb, function () {
30   - if (self.proto) self.proto.cull(id);
  31 + proto.cull(id);
31 32 });
32 33 };
33 34 opts.proto.unwrap = function (ref, id) {

0 comments on commit a8d1e26

Please sign in to comment.
Something went wrong with that request. Please try again.