[sr-dev] need help understanding pv_value_destroy

Luis Azedo luis at 2600hz.com
Sun Jan 4 12:36:22 CET 2015


Hi Daniel,

can you help on this ?

________________________________
From: sr-dev [sr-dev-bounces at lists.sip-router.org] on behalf of Luis Azedo [luis at 2600hz.com]
Sent: Wednesday, December 31, 2014 4:19 AM
To: sr-dev at lists.sip-router.org
Subject: [sr-dev] need help understanding pv_value_destroy

Hi,

in some function that return a value with PV_VAL_PKG or PV_VAL_SHM, the allocated memory is supposed to be freed by core ?

script example

my_function("some param","$var(result)");

in code =>
dst_val->flags = PV_VAL_STR | PV_VAL_PKG;
dst_pv->setf(msg, &dst_pv->pvp, (int)EQ_T, &dst_val);

when $var(result) is freed, will it free the allocated string ?


if( $(myPvar{my.mytransform,transformParameter}) == $null) {
 $var(x) = $(myPvar{my.mytransform,transformParameter});
}

in code =>
dst_val->flags = PV_VAL_STR | PV_VAL_PKG;

will the memory allocated be freed  in the comparison line ?
will the memory allocated be freed  when $var(x) is freed ?

thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150104/dd3512fd/attachment.html>


More information about the sr-dev mailing list