mayurAzoi / idoubs

Automatically exported from code.google.com/p/idoubs
0 stars 0 forks source link

Memory leak on INVITE message #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
a) Before posting your issue you MUST answer to the questions otherwise it
will be rejected (invalid status) by us
b) Please check the issue tacker to avoid duplication
c) Please provide network capture (wireshark) or Android log (DDMS output)
if you want quick response

What steps will reproduce the problem?
1. Receive INVITE message from remote to set the call hold / retrieve
2. Profile application with XCode Instruments
3.

What is the expected output? What do you see instead?

What version of the product or source code revision are you using? On what
operating system?
iOS, Sources Version 2

Please provide any additional information below.
The leak is on the object "NgnInviteEventArgs" declared in function 
"OnDialogEvent" in the file "NgnSipService.mm".
For now I fix the leak simply by declaring the object before the 
NSAutoreleasePool and by releasing it myself at the end of the function.

Original issue reported on code.google.com by robat...@gmail.com on 11 Jan 2012 at 9:38

GoogleCodeExporter commented 9 years ago
There is no leak but with your change you will introduce leak for sure.

OnDialogEvent() is called from a POSIX thread which means that there is no 
default memory pool in place. If you declare your object before the 
NSAutoreleasePool it will never be released.
The object will not leak because it is set to "autorelease".
Instruments is just a helper tool! 

Original comment by boss...@yahoo.fr on 11 Jan 2012 at 11:36