[Development] QTBUG-48709: calling ::exit() may crash

Thiago Macieira thiago.macieira at intel.com
Tue Oct 20 23:05:55 CEST 2015


On Tuesday 20 October 2015 23:51:12 Marc Mutz wrote:
> On Tuesday 20 October 2015 17:56:33 Thiago Macieira wrote:
> > Can anyone think of a solution to this problem?
> 
> Don't call ::exit()? I'm only half-joking. Who calls ::exit() in a C++
> program (apart from implicitly by leaving main())?

The problem in the bug report was return from main without deleting a heap-
allocated QApplication. That one you can clearly blame the application for 
leaking, but then I realised that exit() can cause the same issue.

> Wild guess: maybe std::terminate() works better?

And causes a core dump, which is not usually what's intended.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list