[Live-devel] Stack overflow caused by recursive destructors

Chmelev, Anton Anton.Chmelev at transas.com
Wed Feb 20 00:32:03 PST 2013


Hello,

I'm using liveMedia library to develop video recording application.
Turns out, when you try to record a really big file (like, several hours) you get stack overflow.
The problem is that linked lists are destroyed recursively in the code (eg. AVIIndexRecord in AVIFileSink, ChunkDescriptor in QuickTimeFileSink).
Although this issue can be addressed by incrementing stack size, why not use iterated destruction?

  // Then, delete the index records:
  /// delete fIndexRecordsHead;

  AVIIndexRecord *cur = fIndexRecordsHead;

  while (cur)
  {
    AVIIndexRecord *next = cur->next();

    delete cur;
    cur = next;
  }

____________
Best Regards,
Anton Chmelev
Senior Software Developer
Transas Technologies
www.transas.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130220/fd9f5d5b/attachment.html>


More information about the live-devel mailing list