[Webkit-unassigned] [Bug 72538] WebWorker threads can outlive the QApplication instance

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 23 07:34:37 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=72538





--- Comment #8 from Andrew Wason <rectalogic at rectalogic.com>  2011-11-23 07:34:36 PST ---
(In reply to comment #7)
> It should be enough to deallocate any resources allocated by port's implementation.

The platform specific resource is the QThread itself, and the only time it is destroyed is when the thread exits. Bug 72155 helps somewhat with this by dropping QThread in favor of native threads, but native threads become QAdoptedThreads when WTF::scheduleDispatchFunctionsOnMainThread is called from them to postMessage from the WebWorker - so we have a similar problem.

Perhaps Qt's WTF::scheduleDispatchFunctionsOnMainThread could be changed to connect QCoreApplication::aboutToQuit to a slot that does QThread::wait, and connect QThread::finished to a slot that disconnects that. So this way when QApplication is finished, it will wait for all outstanding worker QThreads to finish. I'll look into this.

Currently my workaround for this bug in my application is to install a signal handler for SIGSEGV when QApplication::exec returns, and in the handler just _exit(0). This is nasty.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list