[openamq-dev] amq_content_basic... destroy vs unlink

Pieter Hintjens ph at imatix.com
Fri Oct 26 13:19:57 CEST 2007


On 10/26/07, Martin Sustrik <sustrik at imatix.com> wrote:

> Pieter outlined some basic reference-counting guidelines, however, I had
> a look at your example and the problem you have is a bit different.

Uhm, Martin, I think you just said exactly what I said with a lot more
words... :-)

The key parts from Dmitri's example are:

    char* cache = content_new();

and

    amq_content_basic_set_body(content, cache, message->nSize, content_destroy);

So content_destroy is the free_fn, called when the content is actually
destroyed.  Which happens when the last reference to it is dropped.

-Pieter


More information about the openamq-dev mailing list