summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp
diff options
context:
space:
mode:
authorTechjar <tecknojar@gmail.com>2018-07-12 20:37:12 -0400
committerTechjar <tecknojar@gmail.com>2018-07-21 00:04:14 -0400
commitcfeffdcf4208686d64d509f559272d64bbd5da70 (patch)
tree661c18a10d3ca134441d4082ddde1231a74cf7ad /Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp
parenta21d536f99ae75f6f8f23870043ed1c8ab19c34d (diff)
Fix more segfaults on NetPlay quit
Basically everything here was race conditions in Qt callbacks, so I changed the client/server instances to std::shared_ptr and added null checks. It checks that the object exists in the callback, and the shared_ptr ensures it doesn't get destroyed until we're done with it. MD5 check would also cause a segfault if you quit without cancelling it first, which was pretty silly.
Diffstat (limited to 'Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp')
-rw-r--r--Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp b/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp
index fbfe64e538..d1b7c97ee4 100644
--- a/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp
+++ b/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp
@@ -59,8 +59,8 @@ void PadMappingDialog::ConnectWidgets()
int PadMappingDialog::exec()
{
- auto* client = Settings::Instance().GetNetPlayClient();
- auto* server = Settings::Instance().GetNetPlayServer();
+ auto client = Settings::Instance().GetNetPlayClient();
+ auto server = Settings::Instance().GetNetPlayServer();
// Load Settings
m_players = client->GetPlayers();
m_pad_mapping = server->GetPadMapping();