mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Move function-scope static QThreadStorage objects to namespace scope
to ensure destruction after all function-scope statics and avoid warning "thread exited after QThreadStorage destroyed".
This commit is contained in:
@@ -116,6 +116,8 @@ namespace BlackGui
|
||||
return (mw && mw->isFrameless());
|
||||
}
|
||||
|
||||
static QThreadStorage<QRegularExpression> tsRegex;
|
||||
|
||||
bool CGuiUtility::lenientTitleComparison(const QString &title, const QString &comparison)
|
||||
{
|
||||
if (title == comparison) { return true; }
|
||||
@@ -127,7 +129,6 @@ namespace BlackGui
|
||||
if (t == c) { return true; }
|
||||
|
||||
// further unify
|
||||
static QThreadStorage<QRegularExpression> tsRegex;
|
||||
if (! tsRegex.hasLocalData()) { tsRegex.setLocalData(QRegularExpression("[^a-z0-9\\s]")); }
|
||||
const QRegularExpression ®exp = tsRegex.localData();
|
||||
t = t.remove(regexp);
|
||||
|
||||
Reference in New Issue
Block a user