aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/multiplayer/state.cpp
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2022-08-03 19:45:13 +0200
committerFearlessTobi <thm.frey@gmail.com>2022-08-15 20:25:42 +0200
commit3fa1a0f8fae9f462ae19892b450001ec9aa67ba1 (patch)
tree8f111c6ec9513d22db27d7b397afad5c7753c1b7 /src/yuzu/multiplayer/state.cpp
parent0351eadbdbe9ec2f06292a230ee2bd14739f4b7b (diff)
yuzu: Fix crash on shutdown
Previously, accessing the room_network when it was already freed would crash the emulator on shutdown. Co-Authored-By: Narr the Reg <5944268+german77@users.noreply.github.com>
Diffstat (limited to 'src/yuzu/multiplayer/state.cpp')
-rw-r--r--src/yuzu/multiplayer/state.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/yuzu/multiplayer/state.cpp b/src/yuzu/multiplayer/state.cpp
index 84ea1aa4cb..dba76b22b0 100644
--- a/src/yuzu/multiplayer/state.cpp
+++ b/src/yuzu/multiplayer/state.cpp
@@ -59,7 +59,9 @@ MultiplayerState::MultiplayerState(QWidget* parent, QStandardItemModel* game_lis
});
}
-MultiplayerState::~MultiplayerState() {
+MultiplayerState::~MultiplayerState() = default;
+
+void MultiplayerState::Close() {
if (state_callback_handle) {
if (auto member = room_network.GetRoomMember().lock()) {
member->Unbind(state_callback_handle);
@@ -71,9 +73,6 @@ MultiplayerState::~MultiplayerState() {
member->Unbind(error_callback_handle);
}
}
-}
-
-void MultiplayerState::Close() {
if (host_room) {
host_room->close();
}