feat: let users delete policy-blocked and orphaned plugins

This commit is contained in:
goat 2022-07-13 21:29:01 +02:00
parent 098607cca8
commit 2c011b6bcd
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
3 changed files with 44 additions and 20 deletions

View file

@ -771,8 +771,8 @@ internal partial class PluginManager : IDisposable, IServiceType
/// <param name="plugin">Plugin to remove.</param>
public void RemovePlugin(LocalPlugin plugin)
{
if (plugin.State != PluginState.Unloaded)
throw new InvalidPluginOperationException($"Unable to remove {plugin.Name}, not unloaded");
if (plugin.State != PluginState.Unloaded && plugin.HasEverStartedLoad)
throw new InvalidPluginOperationException($"Unable to remove {plugin.Name}, not unloaded and had loaded before");
lock (this.pluginListLock)
{