> if (!SFC) {
> SFC = new SimpleFormatContext(Context.getLangOpts());
> TU->FormatContext = SFC;
> - }
> - else if ((TU->FormatInMemoryUniqueId % 10) == 0) {
> + } else if ((TU->FormatInMemoryUniqueId % 10) == 0) {
> + // Delete after some number of iterators, so the buffers don't grow
> + // too large.
> delete SFC;
> SFC = new SimpleFormatContext(Context.getLangOpts());
Hate to drag this out, but why not use an OwningPtr here? A little safer
against future refactoring that misses a delete.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits