[Freeswitch-dev] Newbie question on switch_event_dup() and memory alloc/free in general

Rupa Schomaker rupa at rupa.com
Mon Jun 28 23:33:25 PDT 2010


Yes, you must call destroy on the object if it has it.

On Tue, Jun 29, 2010 at 12:19 AM, Paul Li <plite2012 at gmail.com> wrote:

> A lot of FreeSwitch core APIs, such as switch_event_dup(switch_event_t
> **event, switch_event_t *todup), returns a pointer to an allocated
> memory chunk, should the caller always releases that memory chunk by
> calling a proper API, such as switch_event_destroy(switch_event_t
> **event)?
>
> I could not find any documentation to detail the general rule
> regarding memory allocation/free when using the core APIs.
>
> Thank you for your attention!
>
> _______________________________________________
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>



-- 
-Rupa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20100629/ecb7f6dc/attachment.html 


More information about the FreeSWITCH-dev mailing list