free_message

3

free_message

free message

    #include <cds/msg_queue.h>

      void free_message
      mq_message_t *msg

## Description

Frees message. If data is allocated explicitly it frees it using `cds_free`, if they are allocated implicitly, it is freed together with message. Thus simple data structures are deallocated automatically in both cases. There might be a problem with more complicated structures with internal pointers to other structures - for these you can set destroy function using `set_data_destroy_function`.

## See Also

create_message, create_message_ex, init_message_ex, set_data_destroy_function