diff --git a/capability_test.go b/capability_test.go index d7f55bb8..915b2892 100644 --- a/capability_test.go +++ b/capability_test.go @@ -132,7 +132,7 @@ func TestResolve(t *testing.T) { } t.Run("Clients", func(t *testing.T) { test(t, "Waits for the full chain", func(t *testing.T, p1, p2 Client, r1, r2 Resolver[Client]) { - r1.Fulfill(p2) + r1.Fulfill(p2.AddRef()) ctx, cancel := context.WithTimeout(context.Background(), time.Second/10) defer cancel() require.NotNil(t, p1.Resolve(ctx), "blocks on second promise") diff --git a/localpromise.go b/localpromise.go index fc462cf7..64bc7250 100644 --- a/localpromise.go +++ b/localpromise.go @@ -28,6 +28,7 @@ func (lf localResolver[C]) Fulfill(c C) { iface := NewInterface(seg, capID) lf.p.Fulfill(iface.ToPtr()) lf.p.ReleaseClients() + msg.Release() } func (lf localResolver[C]) Reject(err error) { diff --git a/rpc/senderpromise_test.go b/rpc/senderpromise_test.go index cbedabbe..aa4174be 100644 --- a/rpc/senderpromise_test.go +++ b/rpc/senderpromise_test.go @@ -393,9 +393,7 @@ func TestPromiseOrdering(t *testing.T) { // with the other bootstrap interface: if i == 100 { go func() { - bs := testcapnp.PingPong(c1.Bootstrap(ctx)) - defer bs.Release() - r.Fulfill(bs) + r.Fulfill(testcapnp.PingPong(c1.Bootstrap(ctx))) }() } }