Yes QApplication destructor is invoked last..Does it makes sense to use deleteLater() in the widget destructors instead of existing delete if it could be cleaned up as part of qApp-quit()?
On Wed, 19 Dec, 2018, 12:03 Konstantin Shegunov <kshegu...@gmail.com wrote: > On Tue, Dec 18, 2018 at 8:25 AM Ramakanth Kesireddy <rama.k...@gmail.com> > wrote: > >> Thanks for your mail..Yes did try with valgrind but couldn't detect >> memory issue may be due to the way our app is designed using threading. >> But wondering why it throws segmentation fault if qApp instance is >> created on stack but not on Heap as I understand that it is mandatory to >> construct qApp instance on stack by design. >> > > QObject (and QCoreApplication) doesn't impose such a limitation, no, you > can have them in the heap or stack. I'd be really surprised, though, if you > don't get the same segfault at the point of the delete call. If you mean > that you just don't free it up, however, then that's a major code smell. > From your description I'd hazard a guess that you have a QObject which > outlives the application (probably a global). This is not allowed, and as > Thiago already said you must clean up before the Q*Application's > destructor's run. >
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest