Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Remove plugin commands on unload (fixes #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Mar 19, 2022
1 parent dcbb090 commit 815b178
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BrackeysBot/Plugins/SimplePluginManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
Expand Down Expand Up @@ -306,6 +306,7 @@ public void UnloadPlugin(IPlugin plugin)
plugin.Dispose();

monoPlugin.LoadContext.Unload();
_commands.Remove(plugin);
_loadedPlugins.Remove(plugin);

Logger.Info(string.Format(LoggerMessages.UnloadedPlugin, plugin.PluginInfo.Name, plugin.PluginInfo.Version));
Expand Down

0 comments on commit 815b178

Please sign in to comment.