<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:black;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:black;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:12.0pt;color:black'>To verify if the handle leak I've noticed is in my code or in liveMedia I wrote a really simple program that just start and stops the event loop. I took the latest testRTSPClient.cpp and just replaced main() with a loop that initiates a thread which starts the event loop - StartEventLoop(). The main thread sleeps for 2s and then sets eventLoopWatchVariable making the thread exit. No streams are started, it's just the event loop going up and down.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'>Code attached (testLiveMediaUpDown.cpp). I compile it using VC++; threading probably needs to be adjusted if using other compiler/OS.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'>If I run this and monitor handles used I can see that the handles are incremented by one each time the event loop runs. This can e.g. be done using SysInternal's "Process Explorer" (handle column not on by default). Looking at the handle type I can also see it's the "\Device\Afd" handles that are increasing. I believe "Afd" stands for Auxiliary Function Driver and that it's related to sockets, but "Afd" is new to me as I've have never come across it before.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'>Any idea where that handle leak originates? Could it be Windows specific?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'>/Claes<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Erlandsson, Claes P (CERLANDS) <br><b>Sent:</b> Friday, July 19, 2013 11:20 AM<br><b>To:</b> 'live-devel@lists.live555.com'<br><b>Subject:</b> Seeing small handle leak when repeatedly starting and stopping event loop<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'>When I start and stop the liveMedia event loop I see a small handle leak in my Windows test client. When looking in Process Explorer I can see the amount of file handles with the name "\Device\Afd" growing.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'>I don't have to stream anything for it to occur, i.e. I just start the event loop and then bring it down by setting the flag to 1. It is very possible it's due to some needed cleanup I'm missing.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'>After leaving doEventLoop I delete my trigger(s), call env->reclaim() and delete the TaskScheduler.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'>Is there anything else that should be done?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Courier New";color:black'>/Claes<o:p></o:p></span></p></div></body></html>