mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Throw plugin exception for plugin dispose interface
This commit is contained in:
parent
bae0fa5c0e
commit
526f00261d
1 changed files with 14 additions and 7 deletions
|
|
@ -88,14 +88,21 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
private static async Task DisposePluginAsync(PluginPair pluginPair)
|
private static async Task DisposePluginAsync(PluginPair pluginPair)
|
||||||
{
|
{
|
||||||
switch (pluginPair.Plugin)
|
try
|
||||||
{
|
{
|
||||||
case IDisposable disposable:
|
switch (pluginPair.Plugin)
|
||||||
disposable.Dispose();
|
{
|
||||||
break;
|
case IDisposable disposable:
|
||||||
case IAsyncDisposable asyncDisposable:
|
disposable.Dispose();
|
||||||
await asyncDisposable.DisposeAsync();
|
break;
|
||||||
break;
|
case IAsyncDisposable asyncDisposable:
|
||||||
|
await asyncDisposable.DisposeAsync();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new FlowPluginException(pluginPair.Metadata, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue