aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu_cmd/yuzu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
-rw-r--r--src/yuzu_cmd/yuzu.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index bc4002d8af..6342c5d353 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -249,6 +249,7 @@ struct SdlState {
// Must outlive emu_window, which keeps a pointer to it.
InputCommon::InputSubsystem input_subsystem{};
std::unique_ptr<EmuWindow_SDL3> emu_window;
+ bool network_initialized{};
};
static std::atomic_bool pack_nup_cancel{false};
@@ -353,6 +354,12 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
return SDL_APP_FAILURE;
}
+ state->network_initialized = Network::Init();
+ if (!state->network_initialized) {
+ LOG_CRITICAL(Network, "Failed to initialize room networking");
+ return SDL_APP_FAILURE;
+ }
+
state->system.Initialize();
@@ -555,7 +562,11 @@ extern "C" void SDL_AppQuit(void *appstate, SDL_AppResult result) {
void(state->system.Pause());
state->system.ShutdownMainProcess();
}
+ const bool network_initialized = state->network_initialized;
delete state;
+ if (network_initialized) {
+ Network::Shutdown();
+ }
}
#define VMA_IMPLEMENTATION