<tt><span style="font-size: 10pt;">I am recording h264 to the
QuickTimeFileSink, and I was getting a stack overflow whenever I close my
recorder and the sink gets destructed. I ended up applying the changes below to
iteratively delete the chunks, but I was wondering if there was something I&#39;m
supposed to do in order to clean up the chunks periodically.</span></tt><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><br>
<br>
<tt>I don&#39;t seem to get the stack overflow anymore, but something tells me if
this records for a while and all of these chunks are kept in memory, then it&#39;ll
blow up pretty soon.</tt><br>
<br>
<tt>Thanks.</tt><br>
<tt>Derrick N. Guerrero</tt><br>
<br>
<tt>Index: QuickTimeFileSink.cpp</tt><br>
<tt>===================================================================</tt><br>
<tt>--- QuickTimeFileSink.cpp    (revision 116413)</tt><br>
<tt>+++ QuickTimeFileSink.cpp    (working copy)</tt><br>
<tt>@@ -1098,7 +1098,13 @@</tt><br>
<tt> }</tt><br>
<tt> </tt><br>
<tt> ChunkDescriptor::~ChunkDescriptor() {</tt><br>
<tt>-  delete fNextChunk;</tt><br>
<tt>+    ChunkDescriptor *next = fNextChunk;</tt><br>
<tt>+    while (next) {</tt><br>
<tt>+        ChunkDescriptor *hold = next;</tt><br>
<tt>+        next = hold-&gt;fNextChunk;</tt><br>
<tt>+        hold-&gt;fNextChunk = NULL;</tt><br>
<tt>+        delete hold;</tt><br>
<tt>+    }</tt><br>
<tt> }</tt><br>
<tt> </tt><br>
<tt> ChunkDescriptor* ChunkDescriptor</tt></span>