Wow. Good call. Thanks Konstantin and Bjorn!
It now works as expected.
Sent: Friday, October 27, 2017 at 5:15 AM
From: "Björn Piltz" <bjornpi...@gmail.com>
To: "Jason H" <jh...@gmx.com>
Cc: "interestqt-project.org" <interest@qt-project.org>
Subject: Re: [Interest] QMap crash when using QtConcurrent::blockingMapped()
From: "Björn Piltz" <bjornpi...@gmail.com>
To: "Jason H" <jh...@gmx.com>
Cc: "interestqt-project.org" <interest@qt-project.org>
Subject: Re: [Interest] QMap crash when using QtConcurrent::blockingMapped()
I'm wondering if there isn't a reentrancy issue in QMap.
Almost. QMap works as it should if you only call const members, but as Konstantin said operator[] on a non-const instance is a mutating function.
I am pretty sure your problems will go away if you declare operator() as const. Then, the const version of operator[] will be called.
This is an unfortunate side effect of Qt's implicit sharing of container classes. There is a tiny note here about a similar problem: http://doc.qt.io/qt-5/containers.html#implicit-sharing-iterator-problem
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest