[AGENT++] Thread handle leak (SNMP++ 3.2.21a)

Stoyan Haralampiev tony at gyuvetch.bg
Wed Jan 17 14:25:15 CET 2007


Thanks, Jochen!

Best regards and good luck,
Tony



>-------- Оригинално писмо --------
>От: Jochen Katz  
>Относно: Re: [AGENT++] Thread handle leak (SNMP++ 3.2.21a)
>До: agentpp at agentpp.org
>Изпратено на: Сряда, 2007, Януари 17 00:31:38 GMT+02:00
>----------------------------------
>
>Hi,
>
>> SNMP++ seems to cause handle leakage under Win32 because the thread
>> handle m_hThread that is assigned inside Snmp::start_poll_thread() is
>> not closed via a call to CloseHandle() in Snmp::stop_poll_thread().
>> 
>> Could you, please, confirm this one and eventually give some info
>> when it could get patched?
>
>it can be patched immediately ;-)
>
>Just change stop_poll_thread() to;
>#ifdef WIN32
> ::WaitForSingleObject(m_hThread, INFINITE);
> CloseHandle(m_hThread);
>#elif defined (CPU) && CPU == PPC603
>
>This will be in the next release.
>
>A funny thing: If you don't need the handle after the thread is started,
>you can write code like this:
>CloseHandle(CreateThread(NULL,0, ThreadA,NULL,0,NULL));
>
>
>Regards,
> Jochen
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/agentpp
>

-----------------------------------------------------------------
Заложете на късмета си със Спортингбет!


More information about the AGENTPP mailing list