Avoid infinite loop on plugin unloading.

This commit is contained in:
UnknownShadow200 2016-08-21 20:09:40 +10:00
parent 36ec4f5d31
commit 2b06416426

View File

@ -103,10 +103,12 @@ namespace MCGalaxy {
public static void Unload(Plugin p, bool shutdown) { public static void Unload(Plugin p, bool shutdown) {
try { try {
p.Unload(shutdown); p.Unload(shutdown);
all.Remove(p);
Server.s.Log(p.name + " was unloaded."); Server.s.Log(p.name + " was unloaded.");
} catch { Server.s.Log("An error occurred while unloading a plugin."); } catch (Exception ex) {
Server.ErrorLog(ex);
Server.s.Log("An error occurred while unloading a plugin.");
} }
all.Remove(p);
} }
/// <summary> Unload all plugins </summary> /// <summary> Unload all plugins </summary>