[cfe-commits] r170478 - in /cfe/trunk/tools/libclang: CXComment.cpp SimpleFormatContext.h

Jordan Rose jordan_rose at apple.com
Tue Dec 18 16:10:33 PST 2012


>   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.



More information about the cfe-commits mailing list