On Jul 28, 2012, at 12:07 AM, Andy Gibbs <[email protected]> wrote:

> On Saturday, July 28, 2012 3:42 AM, Jordan Rose wrote:
>> I see. I realize that it's slightly less safe, but is it viable to call
>> FinishCapture in the destructor of CaptureDiagnosticsConsumer? That way
>> there's no ugly explicit cleanup calls in the user. (I realize there are
>> potential problems with that, but it seems a lot cleaner!)
>> 
>> If we can't do that, please do keep the assertion.
> 
> I wished in the first instance to have it inside the destructor, but the
> problem is that the preprocessor instance is created after the
> CaptureDiagnosticConsumer instance and therefore is destructed before
> CaptureDiagnosticConsumer.  Hence the explicit FinishCapture function
> which must be called before the preprocessor goes out of scope.  And
> hence also the assert in the destructor to ensure this order of operation.

Okay, unfortunate but fair enough. Just waiting on 1/4 now.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to