From 9bcf6a8bb7775730d411115725b5c74fb8ac8132 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 21 Jan 2025 22:31:06 -0500 Subject: [PATCH] [bugfix] ensure tree_context dirfilter is restored on plugin exit rockpaint is the only plugin doing anything dit setting the dirfilter pointer it appears to restore it but this is cheap insurance on weird crashes that result.. Change-Id: I70c826d6ec4c9cb6e1539ab23f1de82ca3e67ad1 --- apps/plugin.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/plugin.c b/apps/plugin.c index e3483e08b3..9874d42946 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -913,18 +913,16 @@ int plugin_load(const char* plugin, const void* parameter) #endif ) { - lc_close(current_plugin_handle); - current_plugin_handle = NULL; - splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_MODEL)); - return -1; + hdr = NULL; } - if (hdr->api_version != PLUGIN_API_VERSION || + if (hdr == NULL || hdr->api_version != PLUGIN_API_VERSION || p_hdr->api_size > sizeof(struct plugin_api)) { lc_close(current_plugin_handle); current_plugin_handle = NULL; - splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_VERSION)); + splash(HZ*2, hdr ? ID2P(LANG_PLUGIN_WRONG_VERSION) + : ID2P(LANG_PLUGIN_WRONG_MODEL)); return -1; } @@ -969,7 +967,9 @@ int plugin_load(const char* plugin, const void* parameter) int rc = p_hdr->entry_point(parameter); - tree_unlock_cache(tree_get_context()); + struct tree_context *tc = tree_get_context(); + tree_unlock_cache(tc); + tc->dirfilter = &global_settings.dirfilter; pop_current_activity_without_refresh(); if (get_current_activity() != ACTIVITY_WPS)