File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Flow.Launcher.Core/Plugin Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ public static class PluginManager
2828 public static List < PluginPair > AllPlugins { get ; private set ; }
2929 public static readonly HashSet < PluginPair > GlobalPlugins = new ( ) ;
3030 public static readonly Dictionary < string , PluginPair > NonGlobalPlugins = new ( ) ;
31-
32- private static readonly IPublicAPI _api = Ioc . Default . GetRequiredService < IPublicAPI > ( ) ;
31+
32+ // We should not initialize API in static constructor because it will create another API instance
33+ private static IPublicAPI api = null ;
34+ private static IPublicAPI API => api ??= Ioc . Default . GetRequiredService < IPublicAPI > ( ) ;
3335
3436 private static PluginsSettings Settings ;
3537 private static List < PluginMetadata > _metadatas ;
You can’t perform that action at this time.
0 commit comments