[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >>> More leak fixes are in the attachment. >>> wxCommunicator can reinitialize sipxtapi during runtime so they manifest >>> themselves. >>> >>> Jaroslav Libak >>> >>> > > One more fix. This one fixes a leak of timers during uninitialization. > Timers weren't deleted because deleteTimers required them to be running. > But in SipUserAgent we stop all transaction timers when we receive > message to shut it down. Then we call > SipTransactionList::deleteTransactionTimers which doesn't delete the > timers. Timers arent deleted in handle message as the author of > deleteTimers assumed in this case. But for > SipTransaction::~SipTransaction where we also call deleteTimers we dont > want to delete timers if they are stopped. So I added a new parameter to > deleteTimers to differentiate between these 2 cases. > > Jaroslav Libak > >
This patch is not 100% ok, we need to know whether an OsTimer did fire when it is stopped or not. Then we don't need that parameter. When it is stopped and didn't fire then we can delete it. We could add 1 new bool to OsTimer bool m_bWasFired; which would be set to false in constructor, and whenever timer is started - either manually or because it is a periodic timer. It would be set to true when we fire the timer. Then we would need 1 accessor for reading the variable. This would enable us to find out whether this timer is stopped because someone stopped it or because it fired. (m_bWasFired wouldnt be set to false when we stop timer to keep the information) Jaroslav Libak _______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
