Yes cloned events must be destroyed for sure. Better still what you should so in this case is use a fifo to deliver the cloned event to another thread so you are not blocking in the event handler. You can then destroy it from there.
On Tue, Jun 29, 2010 at 10:03 PM, Paul Li <plite2...@gmail.com> wrote: > I guess you were assuming I would pass the event clone (pointer) to the > core API (such as switch_event_fire), so that I would not need to free the > clone pointer. I guess I still need to destroy it in the following scenario: > > static void my_event_handler(switch_event_t *event) > { > switch_event_t *clone = NULL; > > if (switch_event_dup(&clone, event) == SWITCH_STATUS_SUCCESS) { > > /* use clone in my extended context */ > > switch_event_destroy(&clone); > } > } > > > Anthony Minessale > > Tue Jun 29 12:30:52 PDT 2010 > > > > yes any functions that take pointers to pointers and leave you with null > > will indicate you don't have to do anything. > > > > > _______________________________________________ > FreeSWITCH-dev mailing list > FreeSWITCH-dev@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev > http://www.freeswitch.org > > -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com <msn%3aanthony_miness...@hotmail.com> GTALK/JABBER/PAYPAL:anthony.miness...@gmail.com<paypal%3aanthony.miness...@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org <sip%3a...@conference.freeswitch.org> googletalk:conf+...@conference.freeswitch.org<googletalk%3aconf%2b...@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org