mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
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.
This commit is contained in:
@ -276,9 +276,9 @@ GameListModel* Settings::GetGameListModel() const
|
||||
return model;
|
||||
}
|
||||
|
||||
NetPlay::NetPlayClient* Settings::GetNetPlayClient()
|
||||
std::shared_ptr<NetPlay::NetPlayClient> Settings::GetNetPlayClient()
|
||||
{
|
||||
return m_client.get();
|
||||
return m_client;
|
||||
}
|
||||
|
||||
void Settings::ResetNetPlayClient(NetPlay::NetPlayClient* client)
|
||||
@ -286,9 +286,9 @@ void Settings::ResetNetPlayClient(NetPlay::NetPlayClient* client)
|
||||
m_client.reset(client);
|
||||
}
|
||||
|
||||
NetPlay::NetPlayServer* Settings::GetNetPlayServer()
|
||||
std::shared_ptr<NetPlay::NetPlayServer> Settings::GetNetPlayServer()
|
||||
{
|
||||
return m_server.get();
|
||||
return m_server;
|
||||
}
|
||||
|
||||
void Settings::ResetNetPlayServer(NetPlay::NetPlayServer* server)
|
||||
|
Reference in New Issue
Block a user