mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #6124] [CLOSED] Fix: Plugin implementing IServerEntryPoint and IBasePlugin gets instantiated TWICE. #10830
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/6124
Author: @BaronGreenback
Created: 5/29/2021
Status: ❌ Closed
Base:
master← Head:IServerEntryHost_IPlugin_Dual_Instance📝 Commits (1)
2771477Fix for multiple instances created,📊 Changes
1 file changed (+14 additions, -1 deletions)
View changed files
📝
Emby.Server.Implementations/ApplicationHost.cs(+14 -1)📄 Description
Issue:
If a plugin implements both the IServerEntryPoint and IBasePlugin interfaces it is currently instantiated twice, once as a plugin, and again as a IServerEntryPoint.
This change only creates a new instance if it hasn't already been instantiated in the plugin creation stage, otherwise the plugin generated instance is used.
The current workaround is to create two classes, one a IBasePlugin, and the other a IServerEntryPoint. With this change, only one class is required.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.