Code analysis recommended this

¯\_(ツ)_/¯
This commit is contained in:
appelemac 2016-06-05 19:56:31 +02:00
parent 0b588927e1
commit 1f8dd72606
2 changed files with 18 additions and 3 deletions

View File

@ -14,7 +14,7 @@ using System.Timers;
namespace NadekoBot namespace NadekoBot
{ {
public class NadekoStats public class NadekoStats : IDisposable
{ {
public static NadekoStats Instance { get; } = new NadekoStats(); public static NadekoStats Instance { get; } = new NadekoStats();
@ -231,5 +231,20 @@ namespace NadekoBot
} }
}).ConfigureAwait(false); }).ConfigureAwait(false);
} }
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (disposing)
{
carbonClient.Dispose();
}
}
} }
} }

View File

@ -49,11 +49,11 @@ namespace NadekoBot.Modules.Searches.Commands
string result = parser.Parse(expression).ToString(); string result = parser.Parse(expression).ToString();
return result; return result;
} }
catch (OverflowException e) catch (OverflowException)
{ {
return $"Overflow error on {expression}"; return $"Overflow error on {expression}";
} }
catch (FormatException e) catch (FormatException)
{ {
return $"\"{expression}\" was not formatted correctly"; return $"\"{expression}\" was not formatted correctly";
} }