On Friday 28 January 2011 11:56:37 [email protected] wrote:
> So:
>
> void cleanup(chid ChanID) {
> void* pUserPrivate;
>
> pUserPrivate = ca_puser(ChanID);
> free(pUserPrivate);
> ca_clear_channel(ChanID);
> }
> ?
Looks reasonable, assuming you used the {m|c|re}alloc() routine to get the
pointer in the first place and you never set puser to anything else other than
zero.
BTW on Windows you have to call free() from the same DLL as the *alloc() call.
- Andrew
--
If a man is offered a fact which goes against his instincts, he will
scrutinize it closely, and unless the evidence is overwhelming, he will
refuse to believe it. If, on the other hand, he is offered something
which affords a reason for acting in accordance to his instincts, he
will accept it even on the slightest evidence. -- Bertrand Russell
- Replies:
- Re: ca_create_channel memory management pthomas
- References:
- ca_create_channel memory management pthomas
- Re: ca_create_channel memory management Andrew Johnson
- Re: ca_create_channel memory management pthomas
- Navigate by Date:
- Prev:
Re: ca_create_channel memory management pthomas
- Next:
Re: ca_create_channel memory management pthomas
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: ca_create_channel memory management pthomas
- Next:
Re: ca_create_channel memory management pthomas
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|