[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
This commit is contained in:
William Wilgus 2025-01-21 22:31:06 -05:00 committed by William Wilgus
parent f3a858e16c
commit 9bcf6a8bb7

View file

@ -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)