[Interest] BRe: can the QRegExpEngine cache acces objects belonging to an unloaded library during global destruction?

René J. V. Bertin rjvbertin at gmail.com
Wed Jan 31 16:13:53 CET 2018

Thiago Macieira wrote:

> Are you making modifications on top of Qt 5.9

Yes, indeed. It's what I have installed, and I'm hoping this kind of small 
internal change would be acceptable for the current LTS release.

> In any case, don't make it a member. File-level static QBasicMutex is fine,
> that's what it exists for.

OK, will stick with that then. There's never supposed to be more than 1 
EngineClass instance anyway.

As I said, I want to run this patch for a while myself before putting it up for 
review. But anyone interested can find the current version here:

> 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? :)

> 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.


More information about the Interest mailing list