<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 14 (filtered medium)">
<base href="x-msg://195/"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">I am currently working on the InbandTextTracks in webkit and I am trying to understand how the memory is released.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">When we launch the track-in-band.html layout test, two in-band text tracks have been created and added, the corresponding RefPtr has a refCount equals to three.<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">1. Why are there 3 owners for each in-band text track? Is there an hidden cache mechanism?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">After this test, if we load another page, the player is destroyed and the clearTextTracks method is called.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">In my understanding, the player should be the only owner of in-band text tracks and thus after the clearTextTracks method is called, the ref count should be decreased to 0 and
 the in-band text track object should be deleted.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">In fact, after the clearTextTracks method the ref count isn&#8217;t equals to 0 thus the in-band text track object isn&#8217;t deleted.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">This text track object is deleted when the clear memory cache is called.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">2<span style="color:#1F497D">.</span> Is it a normal behavior? If yes, what is the interest to use smart pointer?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">3<span style="color:#1F497D">.</span> How does the clear memory cache know that this ref pointer (with a ref count != 0) can be released?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Thanks in advance for your explanations,&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Benjamin Dupont.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>