aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 74b262e86d..5bba745ae2 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -112,7 +112,8 @@ quintptr getStackLimit()
void* stackBottom = 0;
pthread_attr_t attr;
#if HAVE(PTHREAD_NP_H) && OS(FREEBSD)
- if (pthread_attr_get_np(pthread_self(), &attr) == 0) {
+ // on FreeBSD pthread_attr_init() must be called otherwise getting the attrs crashes
+ if (pthread_attr_init(&attr) == 0 && pthread_attr_get_np(pthread_self(), &attr) == 0) {
#else
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
#endif