On Wednesday, 31 January 2018 07:13:53 PST René J. V. Bertin wrote: > > You have the symptom of QBasicMutex containing garbage. It is thinking the > > mutex is locked. > > Right. Or not, and then trying to lock it upon my request. Using > uninitialised variables is kind of UB too, no?
Correct. You can copy uninitialised values if you use byte-level access, so memcpy is allowed, but you can't make decisions using them. > > QMutex as a member variable in the class is fine too. Just don't make it > > static. > > Why would I do that? Moving the mutex into the class only makes sense if you > want to be able to lock different instances independently; making it a > static member wouldn't change anything w.r.t. to current code, in practice. If you only have one instance, then having it inside the class means you still have only 1. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest