[cfe-dev] Quit Application Error.

Bruce Stephens bruce.r.stephens at gmail.com
Mon Aug 23 03:43:06 PDT 2010


Paul Griffiths <gafferuk-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
writes:

> Ni im not deleting anything, Im running each instance of clang in it's
> own thread, when I want to quit the app, the thread calles
> llvm::llvm_shutdown()  and exits.
>
> Even if theres only one instance of clang running, it throws an error
> when I quit.

IIUC the ownership patterns in Diagnostic changed relatively recently,
so (for example) the clang-interpreter is incorrect.  Currently it has:

  TextDiagnosticPrinter DiagClient(llvm::errs(), DiagnosticOptions());

  Diagnostic Diags(&DiagClient);

I think this should now be something like

  TextDiagnosticPrinter* DiagClient = new TextDiagnosticPrinter(llvm::errs(), DiagnosticOptions());

  Diagnostic Diags(DiagClient);

i.e., the destructor for Diagnostic will attempt to delete DiagClient
which might well be the crash you're seeing?

[...]



More information about the cfe-dev mailing list