[Interest] Segmentation fault on exiting Qt event loop

Thiago Macieira thiago.macieira at intel.com
Mon Dec 17 18:05:45 CET 2018


On Monday, 17 December 2018 02:43:36 PST Ramakanth Kesireddy wrote:
> Why does the QApplication instance throw seg fault when created on stack?

Because there's a bug somewhere. It's likely the problem is in your code. I 
recommend trying to valgrind your application and/or reducing it until you 
find what the issue is.

> Should the cleanup of resources be done before
> qApp->quit() is called using aboutToQuit() signal?

Not necessarily. You can clean up after exec() finished. Just remember that 
you must clean up all widgets before the QApplication destructor and hopefully 
all QObjects before the QCoreApplication one. Depending on unload-time 
destructors is prone to problems.

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






More information about the Interest mailing list