go-capnp
go-capnp copied to clipboard
Fix #306
Also, document the fact that ClientPromise.Fulfill steals the reference.
Mixing this up was the root cause of the issue. Specifically both Promise.ReleaseClients() and Message.Reset() were releasing the same clients, causing them to be invalid if later used.
This patch just adds a call to .AddRef() in the appropriate spot, so that the promise has its own references to the clients, as the API suggests.
N.B. this patch is stacked on top of #310 to avoid conflicts; that PR should be reviewed & merged first.
Test suite is hanging; I got so excited when it fixed ocap-md I forgot to run the tests :sweat_smile:
Marking as a draft while I figure out what's wrong.
Looks like the test failures are due to release messages not being sent, which is not a surprising symptom of a regression -- so I still have some debugging to do. Will look at it more tomorrow.
I'm going to close this one. The ownership questions could use better documentation, but this is not the correct solution.