Yes we do have Qt running in worker thread(pthread)..Does it throws segmentation fault if we donot wait for the thread(like pthread::join) to exit event loop and destroy objects accordingly?
On Mon, 17 Dec, 2018, 17:00 Konstantin Shegunov <kshegu...@gmail.com wrote: > On Mon, Dec 17, 2018 at 1:26 PM Andrew Ialacci <and...@dkai.dk> wrote: > >> I’ve had this issue on Windows especially when destroying worker threads >> on an application exit. >> > > Which you shouldn't do. > > What I ended up doing was sleeping the main thread until each worker >> threads isRunning() return false; >> >> I’d love to know if this is the //best// solution to this problem but >> from what I’ve found it works very well. >> > > Nope. Call QThread::quit or QThread::requestInterruption (depending on > whether you have a running event loop in the thread(s)). And wait for them > with QThread::wait before allowing the QThread objects to be destroyed. >
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest