Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.4, 4.8.0, 5.2.0
-
Windows 7, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010/2012
-
4e73732d3e72ea59d39ec5a5c01c2e76bbff7dc1 (4.8) , 71f6dee8791c95fd862ca3651d7f4b7d6b9f440e (5.3)
Description
When a QScriptEngine is created in a native thread on Windows a crash occurs. It appears to be a race condition when destroying data for the adopted thread. This only happens for me on Windows. I have not been able to reproduce this on Linux or Mac OS X. The workaround is to create the QScriptEngine in a QThread instead of the native Windows thread.
I am attaching 2 examples:
main_crash.cpp - shows how the crash happens
main_nocrash.cpp - shows the workaround I am using to prevent this crash
Let me also note that this only happens when I create a QScriptEngine whether on the heap or the stack. If I create a regular QObject, this issue does not occur. It happens in Qt 4.7.4 and Qt 4.8.0 RC for me.
Attachments
For Gerrit Dashboard: QTBUG-22926 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
87095,2 | Fix crash when creating a QScriptEngine in a native thread | 5.3 | qt/qtscript | Status: MERGED | +2 | 0 |