plugin: don't start plugin when another non-tsr plugin is running

Change-Id: Ie5fc8220e5d586a5493992719c55e9d2f235b090
This commit is contained in:
Roman Artiukhin 2024-11-04 17:02:44 +02:00 committed by Christian Soffke
parent eb91595988
commit e519356c47

View file

@ -860,8 +860,16 @@ int plugin_load(const char* plugin, const void* parameter)
const char *sepch = strrchr(plugin, PATH_SEPCH); const char *sepch = strrchr(plugin, PATH_SEPCH);
bool theme_enabled = sepch && !strcmp("properties.rock", sepch + 1); bool theme_enabled = sepch && !strcmp("properties.rock", sepch + 1);
if (current_plugin_handle && pfn_tsr_exit) if (current_plugin_handle)
{ /* if we have a resident old plugin and a callback */ {
if (!pfn_tsr_exit)
{
/* not allowing another plugin to load */
logf("Attempt to load plugin `%s` while another non-TSR plugin `%s` is running.", plugin, current_plugin);
return PLUGIN_OK;
}
/* if we have a resident old plugin and a callback */
bool reenter = (strcmp(current_plugin, plugin) == 0); bool reenter = (strcmp(current_plugin, plugin) == 0);
int exit_status = pfn_tsr_exit(reenter); int exit_status = pfn_tsr_exit(reenter);
if (exit_status == PLUGIN_TSR_CONTINUE) if (exit_status == PLUGIN_TSR_CONTINUE)