Hi, >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On >Behalf Of ext Stefano Sabatini >Sent: Monday, September 01, 2008 3:44 PM >To: sofia-sip-devel@lists.sourceforge.net >Subject: Re: [Sofia-sip-devel] How to free a sdp_session_t struct > >>>> Free the home used for allocating the session. >>> >>> Hi, and thanks for the reply. >>> Yes that's a solution, nonetheless it looks still weird to >me, to have >>> to use an home just for that seems >>> overkill. >> >> There is also this problem. Assuming that I have to pass around the >> allocated home, I can't use a stack allocated home, so I >> have to use su_home_new() (here choosing an arbitrary size value...). >> >> Then I think there is no way to know the home used by an >sdp_session_t >> object, so I would have to pass around the home >> object to which the sdp_session_t is bound, which is pretty awkward, >> *either* to have a memleak. > >Another solution could be to pass around sdp_parser_t rather than >sdp_session_t, then >use sdp_session() to get the sdp_session_t from the parser and free >both parser and >session with sdp_parser_free(), do you think this is an >acceptable solution? > >But still this looks like a strange solution and not particularly >convenient (why to pass around the whole parser if what I need is just >the session?), and is the reason for which I was looking for an >sdp_session_free() function.
I guess you don't really want to keep the parser state. A home is a pool for allocated memory in the Sofia stack, so yes, you need to pass it around to wherever you free the sdp_session_t. Kind regards, Mikhail ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel