On Fri, Mar 8, 2013 at 4:54 AM, Phil Harvey <p...@philharveyonline.com>wrote:

> Thanks for the reply.  I haven't yet figured out whether I completely agree
> with your reasoning, but it is really useful to see the intention behind
> these functions written down in black and white.
> Keith and I are going to be writing more tests for Delivery quite soon, so
> I'd like to defer the full resolution of these questions (including
> JNIDelivery state/memory management issues) until then.  For now, I will
> just document this discrepancy in a TODO in the Delivery.isSettled JavaDoc.
> Also, would you be able to add a comment to pn_delivery_settled to hint
> that it is not simply the property accessor counterpart to
> pn_delivery_settle?

I can do that.

Looking into this has made me start to think pn_delivery_free() could be a
better name for what pn_delivery_settle() is actually doing. There is an
open JIRA arising from someone not realizing that pn_delivery_settle
renders the delivery pointer invalid, so one possibility would be to change
pn_delivery_settle to pn_delivery_free. This would help signal the
appropriate memory management aspects of the operation, and would break the
settle/settled pairing.


Reply via email to