From 553e331bae5d07958963d818e086ff905eb74343 Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 17 Jul 2013 17:34:17 -0400 Subject: [PATCH] sceNet.cpp: Reset & initialise all variables properly upon Init and Shutdown. --- Core/HLE/sceNet.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 00b27d77b..975786166 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -106,15 +106,23 @@ struct ApctlHandler { static std::map apctlHandlers; void __NetInit() { - netInited = false; - netAdhocInited = false; - netApctlInited = false; - netInetInited = false; - memset(&netMallocStat, 0, sizeof(netMallocStat)); + __ResetInitNetLib(); } void __NetShutdown() { + __ResetInitNetLib(); +} +void __ResetInitNetLib() { + netInited = false; + netAdhocInited = false; + netAdhocctlInited = false; + netAdhocMatchingInited = false; + netApctlInited = false; + netInetInited = false; + adhocctlHandlers.clear(); + + memset(&netMallocStat, 0, sizeof(netMallocStat)); } void __UpdateAdhocctlHandlers(int flag, int error) {