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.