mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Common/TraversalClient: Use correct deleter with g_MainNetHost
Previously this was using the default deleter (which just calls delete on the pointer), which is incorrect, since the ENetHost instance is allocated through ENet's C API, so we need to use its functions to deallocate the host instead.
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include <enet/enet.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/ENet.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/TraversalProto.h"
|
||||
|
||||
@ -91,7 +92,7 @@ private:
|
||||
};
|
||||
extern std::unique_ptr<TraversalClient> g_TraversalClient;
|
||||
// the NetHost connected to the TraversalClient.
|
||||
extern std::unique_ptr<ENetHost> g_MainNetHost;
|
||||
extern Common::ENet::ENetHostPtr g_MainNetHost;
|
||||
// Create g_TraversalClient and g_MainNetHost if necessary.
|
||||
bool EnsureTraversalClient(const std::string& server, u16 server_port, u16 listen_port = 0);
|
||||
void ReleaseTraversalClient();
|
||||
|
Reference in New Issue
Block a user