GnuGK memory leak / not deleted calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

Latest GnuGK 2.0x have stable memory leak at fixed place.

After call completed gnugk generate CDR and move
current call (CallRec) into RemovedList.

CheckCalls() function called each second and check list
of calls inside RemovedList. It must do final delete
of CallRec objects in this list that not marked as used.

Problem that calls are marked as "used" forever and
as result calls stay undeleted inside RemovedList.
This fact is source point of memory leak described
in this mail.

Patch that show this problem attached.

Can anybody comment how to solve this problem ?

Thanks in advance

Igor Ivanov

========================================================

Patch:

diff -u ./openh323gk/RasTbl.cxx ./memoryleak/RasTbl.cxx
--- ./openh323gk/RasTbl.cxx     Fri Dec 26 08:59:31 2003
+++ ./memoryleak/RasTbl.cxx     Wed Nov 24 00:59:46 2004
@@ -1989,6 +1989,22 @@
                ConfigReloadMutex.EndRead();
 #endif
 
+       {
+           PTRACE(6,"Check RemovedList now");
+           iterator i = RemovedList.begin();
+           iterator e = RemovedList.end();
+           while (i!=e)
+           {    
+               CallRec *cc=(CallRec *)*i;
+               if (cc->IsUsed())
+                   PTRACE(6,"!!! USED CALL IN RemovedList / can not delete    Call N " << cc->GetCallNumber());
+               else
+                   PTRACE(6,"Good / ready for delete call in RemovedList   Call N " << cc->GetCallNumber());           
+               i++;
+           }
+           PTRACE(6,"Check RemovedList done");
+       }
+
        Iter = partition(RemovedList.begin(), RemovedList.end(), mem_fun(&CallRec::IsUsed));
        for_each(Iter, RemovedList.end(), deleteobj<CallRec>());
        RemovedList.erase(Iter, RemovedList.end());

Attachment: memleak.patch
Description: Binary data


[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux