From 277c66d9d2ff3813f3d9f3ba793d85c74e835f11 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 23 Jan 2025 19:50:48 -0500 Subject: [PATCH] : [bugfix,bugfix] ensure PREVIOUS tree_context dirfilter is restored on plugin exit Change-Id: I521e8d660ca76744f5452643578c2f7e5651b870 --- apps/plugin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/plugin.c b/apps/plugin.c index 9874d42946..d138e356fd 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -949,7 +949,9 @@ int plugin_load(const char* plugin, const void* parameter) push_current_activity(ACTIVITY_PLUGIN); /* some plugins assume the entry cache doesn't move and save pointers to it * they should be fixed properly instead of this lock */ - tree_lock_cache(tree_get_context()); + struct tree_context *tc = tree_get_context(); + tree_lock_cache(tc); + int *last_dirfilter_p = tc->dirfilter; /* store incoming dirfilter pointer */ if (!theme_enabled) FOR_NB_SCREENS(i) @@ -965,11 +967,11 @@ int plugin_load(const char* plugin, const void* parameter) plugin_check_open_close__enter(); - int rc = p_hdr->entry_point(parameter); + int rc = p_hdr->entry_point(parameter); /* run the loaded plugin */ - struct tree_context *tc = tree_get_context(); + /* unlock the tree and restore the dirfilter pointer */ tree_unlock_cache(tc); - tc->dirfilter = &global_settings.dirfilter; + tc->dirfilter = last_dirfilter_p; pop_current_activity_without_refresh(); if (get_current_activity() != ACTIVITY_WPS)