2008/1/3, Fabio Margarido <[EMAIL PROTECTED]>:
> On Jan 3, 2008 11:46 AM, Pekka Pessi <[EMAIL PROTECTED]> wrote:
> > I have no idea. It seems to be that your problem is because the
> > freelist is corrupted, and it should be possible to detect that with
> > valgrind. Are you using NDEBUG? By default, the stack fills the freed
> > memory with garbage, but if you have NDEBUG defined, it does not.
>
> I ran configure with --enable-ndebug, but the funny thing is I didn't
> see -DNDEBUG in the compilation commands anywhere. There's a detail in
> my implementation that I a little suspicious about. I have a class
> that represents a SIP call, and associated with each object of this
> class is a su_home_t instance. I don't know if that's a bad design
> decision, but if you feel that might be a problem, it could be
> changed. The destructor of this class calls su_home_unref for the
> object's instance of su_home_t. While I'm at it, the whole list of
> sofia calls my destructor does is, in order:
>
> nua_handle_magic, to obtain my context associated to the call, and
> then free on the pointer returned;

And subsequent call to nua_handle_bind(nh, NULL)?

> nua_handle_unref (it was nua_handle_destroy, but someone on the list
> suggested I changed it);

Please, use nua_handle_destroy(). You may get events after nua_handle_unref()

> nua_destroy_event (for all the saved events I have on a list in each object);
> su_home_deinit on the object's memory home.

> Do you see any problem with this approach? I'm thinking of leaving the
> su_home_t of each object pointing to NULL instead of using
> su_home_init in the constructor and see where that goes.

Unless you call nua_handle_destroy() you may get events from stack and
if you do not call nua_handle_bind(nh, NULL) the stack keeps your
stale pointer around and passes it to your callback in events...

I send this to list, too..

-- 
Pekka.Pessi mail at nokia.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to