summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Artiukhin <bahusdrive@gmail.com>2024-11-04 17:02:44 +0200
committerChristian Soffke <christian.soffke@gmail.com>2024-11-09 04:26:15 -0500
commite519356c473b081bc012fe49f09b7c755c355978 (patch)
tree74eab392c93c6f6076f00d147e425e1c231f89cf
parenteb91595988ebd7e80dbb920e8004fc1f9c074411 (diff)
downloadrockbox-e519356c47.tar.gz
rockbox-e519356c47.zip
plugin: don't start plugin when another non-tsr plugin is running
Change-Id: Ie5fc8220e5d586a5493992719c55e9d2f235b090
-rw-r--r--apps/plugin.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index adf207da79..a2bfc2f3fc 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -860,8 +860,16 @@ int plugin_load(const char* plugin, const void* parameter)
const char *sepch = strrchr(plugin, PATH_SEPCH);
bool theme_enabled = sepch && !strcmp("properties.rock", sepch + 1);
- if (current_plugin_handle && pfn_tsr_exit)
- { /* if we have a resident old plugin and a callback */
+ if (current_plugin_handle)
+ {
+ 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);
int exit_status = pfn_tsr_exit(reenter);
if (exit_status == PLUGIN_TSR_CONTINUE)