[reSIProcate] Memory Leak on Resip 1.6

Scott Godin sgodin at sipspectrum.com
Tue May 24 10:49:14 CDT 2011


Not sure what getEventFromMessage does, but you must "delete" the SipMessage
returned from Stack::receive, or it will leak.

Scott

On Tue, May 24, 2011 at 11:21 AM, Jijo <realjijo at gmail.com> wrote:

> Hi,
> I have been trying to detect a memory allocation problem in resiprocate. I
> run valgrind and totalview and they point at the  "receive" message that
> gets the SipMessage pointer. The memory allocation keeps growing. I use
> shared pointers. Any advice appreciated . Here's sample code from my
> application :
>
>    ::receiveEvent() // gets messages, puts it in an event. Events are in a
> queue. Event is my own private class
>   for(msgcount = 0; (msg = m_stack.receive()); ++msgcount)
>       {
>          SharedPtr<Event> *event = getEventFromMessage(msg);
>          LOG(LOG_INFO, "Adding event %s to the event queue",
> (*event)->name());
>          m_event_queue.add(event)
>       }
>
>       // In another part of program, process event
> ::processEvent()
> {
>        SharedPtr<Event> event = m_event_if.getEvent(100);
>         // get SipMessage from event
>         // event goes out of scope.
> }
>
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20110524/faa164a1/attachment.htm>


More information about the resiprocate-devel mailing list