mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Avoid infinite loop on plugin unloading.
This commit is contained in:
parent
36ec4f5d31
commit
2b06416426
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user