I just pushed a quick update of the docs that will hopefully make this clear, but pn_data_get_string (and similar) copies the bytes passed to it into an internal area inside the pn_data_t. The converse, pn_data_get_string(...) returns a pointer to the internal bytes, so those need to be copied if you are going to clear or free the pn_data_t.
--Rafael On Wed, Feb 18, 2015 at 4:35 AM, Michael Ivanov <iv...@logit-ag.de> wrote: > Greetings! > > I need to confirm a point about pn_data_put_string usage. Second argument > is > pn_bytes_t which contains pointer to text buffer and actual length of the > string > in bytes. When this value is assigned to data node does it mean that the > ownership > of the string buffer is transfered to data object? Will pn_data_clear (or > pn_data_free) > try to free such buffers? Or is it assumed that the string memory will be > managed > outside of pn_data_t? > > Best regards, > -- > \ / | | > (OvO) | Mikhail Iwanow | > (^^^) | Voice: +7 (911) 223-1300 | > \^/ | E-mail: iv...@logit-ag.de | > ^ ^ | | > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org > For additional commands, e-mail: users-h...@qpid.apache.org > >