mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
[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:
parent
f3a858e16c
commit
9bcf6a8bb7
1 changed files with 7 additions and 7 deletions
|
|
@ -913,18 +913,16 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
lc_close(current_plugin_handle);
|
hdr = NULL;
|
||||||
current_plugin_handle = NULL;
|
|
||||||
splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_MODEL));
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdr->api_version != PLUGIN_API_VERSION ||
|
if (hdr == NULL || hdr->api_version != PLUGIN_API_VERSION ||
|
||||||
p_hdr->api_size > sizeof(struct plugin_api))
|
p_hdr->api_size > sizeof(struct plugin_api))
|
||||||
{
|
{
|
||||||
lc_close(current_plugin_handle);
|
lc_close(current_plugin_handle);
|
||||||
current_plugin_handle = NULL;
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -969,7 +967,9 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
|
|
||||||
int rc = p_hdr->entry_point(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();
|
pop_current_activity_without_refresh();
|
||||||
if (get_current_activity() != ACTIVITY_WPS)
|
if (get_current_activity() != ACTIVITY_WPS)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue