From bb28c2efa860d4a4410f54dcfc5a040955c671ca Mon Sep 17 00:00:00 2001 From: spirifoxy Date: Sun, 29 Oct 2017 04:33:59 +0700 Subject: [PATCH] Fix V3114 warnings from PVS-Studio Static Analyzer --- MIMWebClient/Core/Events/Communicate.cs | 4 ++-- MIMWebClient/Core/Player/Experience.cs | 1 + MIMWebClient/Hubs/MIMHub.cs | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MIMWebClient/Core/Events/Communicate.cs b/MIMWebClient/Core/Events/Communicate.cs index 26d6e57..5418edc 100644 --- a/MIMWebClient/Core/Events/Communicate.cs +++ b/MIMWebClient/Core/Events/Communicate.cs @@ -255,7 +255,7 @@ public static void NewbieChannel(string message, Player player) var discordBot = new HomeController(); discordBot.PostToDiscord(discordToSay); - + discordBot.Dispose(); } @@ -289,7 +289,7 @@ public static void OocChannel(string message, Player player) var discordBot = new HomeController(); discordBot.PostToDiscord(discordToSay); - + discordBot.Dispose(); } } diff --git a/MIMWebClient/Core/Player/Experience.cs b/MIMWebClient/Core/Player/Experience.cs index 62521b6..e4fc017 100644 --- a/MIMWebClient/Core/Player/Experience.cs +++ b/MIMWebClient/Core/Player/Experience.cs @@ -114,6 +114,7 @@ public void GainLevel(PlayerSetup.Player player) var discordBot = new HomeController(); discordBot.PostToDiscord(discordToSay); + discordBot.Dispose(); } } diff --git a/MIMWebClient/Hubs/MIMHub.cs b/MIMWebClient/Hubs/MIMHub.cs index a0279a9..c83f017 100644 --- a/MIMWebClient/Hubs/MIMHub.cs +++ b/MIMWebClient/Hubs/MIMHub.cs @@ -366,8 +366,8 @@ public void charSetup(string id, string name, string email, string password, str var discordToSay = "A new character called, " + PlayerData.Name + " has entered the realm."; var discordBot = new HomeController(); - discordBot.PostToDiscord(discordToSay); - + discordBot.PostToDiscord(discordToSay); + discordBot.Dispose(); } public void Login(string id, string name, string password) @@ -446,7 +446,7 @@ public void Login(string id, string name, string password) var discordBot = new HomeController(); discordBot.PostToDiscord(discordToSay); - + discordBot.Dispose(); }