RE: [reSIProcate] Memory leaks
- From: "Derek MacDonald" <derek@xxxxxxxx>
- Date: Tue, 21 Dec 2004 12:50:36 -0800
Hi Guys,
Be very careful; are you certain that the message isn't being deleted by the
application? For example, DUM puts deletes all message that it gets from the
SipStack, so the memory associated with the timer(the message passed in to
postMS) will be deleted. I doubt that this is really a memory leak.
I added a virtual destructor to ExternalDns, so ares_destroy should be
called now.
--Derek
> -----Original Message-----
> From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:resiprocate-
> devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of kaiduan xie
> Sent: Tuesday, December 21, 2004 11:57 AM
> To: Dmitry Semyonov; resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [reSIProcate] Memory leaks
>
> Dimitry,
>
> You may try to add the following destructor in
> TimerQueue.cxx:
>
> //xkd-2004-11-4
> TimeLimitTimerQueue::~TimeLimitTimerQueue()
> {
> // delete the message associated with the timer
> for (std::multiset<Timer>::iterator i =
> mTimers.begin(); i != mTimers.end(); ++i)
> {
> if (i->getMessage())
> delete i->getMessage();
> }
> }
>
> kaiduan
>
> --- Dmitry Semyonov <dsemyonov@xxxxxxx> wrote:
> > Hello!
> >
> > I see several memory leaks with the r3746 version of
> > reSIProcate
> > on Windows platform:
> >
> > 1. It seems ares_destroy() is never called, although
> > it has to be,
> > according to the code. Probably, this is due to
> > misconfiguration of my
> > project settings... Does anybody else see this leak?
> >
> > 2. A message created inside the following function
> > is never deleted.
> >
> > Message*
> > DumTimeout::clone() const
> > {
> > return new DumTimeout(*this);
> > }
> >
> > The function is called from within
> >
> > void
> > SipStack::postMS(const ApplicationMessage& message,
> > unsigned int ms)
> > {
> > assert(!mShuttingDown);
> > Message* toPost = message.clone();
> > Lock lock(mAppTimerMutex);
> > mAppTimers.add(Timer(ms, toPost));
> > }
> >
> > and the message is added then to some kind of
> > TimerQueue.
> >
> > Can someone familiar with the above code look into
> > this problem?
> > TIA
> >
> > --
> > ...Bye..Dmitry.
> > _______________________________________________
> > resiprocate-devel mailing list
> > resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> >
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
> >
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel