[Interest] Segmentation fault on exiting Qt event loop

Ramakanth Kesireddy rama.kesi at gmail.com
Tue Dec 18 07:14:01 CET 2018


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.

On Mon, 17 Dec, 2018, 23:58 Thiago Macieira <thiago.macieira at intel.com
wrote:

> 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
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20181218/39c5a133/attachment.html>


More information about the Interest mailing list