mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-04-10 06:11:54 +10:00
core/log: crash if Quickshell's log filter is installed twice
Crashes from recursion inside filterCategories through the old filter have been observed. Presumably this means the log filter is getting installed twice somehow. This should catch it.
This commit is contained in:
parent
5bf6a412b0
commit
7c5a6c4bd4
1 changed files with 7 additions and 2 deletions
|
|
@ -310,10 +310,15 @@ void LogManager::init(
|
||||||
instance->rules->append(parser.rules());
|
instance->rules->append(parser.rules());
|
||||||
}
|
}
|
||||||
|
|
||||||
qInstallMessageHandler(&LogManager::messageHandler);
|
|
||||||
|
|
||||||
instance->lastCategoryFilter = QLoggingCategory::installFilter(&LogManager::filterCategory);
|
instance->lastCategoryFilter = QLoggingCategory::installFilter(&LogManager::filterCategory);
|
||||||
|
|
||||||
|
if (instance->lastCategoryFilter == &LogManager::filterCategory) {
|
||||||
|
qCFatal(logLogging) << "Quickshell's log filter has been installed twice. This is a bug.";
|
||||||
|
instance->lastCategoryFilter = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
qInstallMessageHandler(&LogManager::messageHandler);
|
||||||
|
|
||||||
qCDebug(logLogging) << "Creating offthread logger...";
|
qCDebug(logLogging) << "Creating offthread logger...";
|
||||||
auto* thread = new QThread();
|
auto* thread = new QThread();
|
||||||
instance->threadProxy.moveToThread(thread);
|
instance->threadProxy.moveToThread(thread);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue