càrrega de recursos no bloquejant

This commit is contained in:
2026-04-14 18:10:28 +02:00
parent d493ebf4f0
commit 8706b2c7fb
15 changed files with 356 additions and 118 deletions
+14 -3
View File
@@ -36,7 +36,11 @@ namespace GlobalEvents {
// Reasignar siempre: tanto en arranque como en hotplug en caliente.
Options::gamepad_manager.assignAndLinkGamepads();
Options::gamepad_manager.resyncGamepadsWithPlayers();
ServiceMenu::get()->refresh();
// Durante el preload ServiceMenu aún no existe: solo refresca si está vivo.
if (ServiceMenu::get() != nullptr) {
ServiceMenu::get()->refresh();
}
if (startup_in_progress || message.empty()) {
return;
@@ -51,7 +55,11 @@ namespace GlobalEvents {
message.replace(pos, std::string(" DISCONNECTED").length(), " " + Lang::getText("[NOTIFICATIONS] DISCONNECTED"));
}
Notifier::get()->show({message});
// Notifier también puede no existir todavía si la notificación se
// disparase antes de finishBoot(). Protegido por si acaso.
if (Notifier::get() != nullptr) {
Notifier::get()->show({message});
}
}
void markStartupComplete() {
@@ -79,7 +87,10 @@ namespace GlobalEvents {
break;
}
ServiceMenu::get()->handleEvent(event);
// Durante el preload ServiceMenu aún no existe
if (ServiceMenu::get() != nullptr) {
ServiceMenu::get()->handleEvent(event);
}
Mouse::handleEvent(event);
handleInputEvents(event);
}