summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-12-03 05:08:09 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-12-03 07:41:33 -0500
commit3957aa87205e8263384f7b50ed18c1df0de0b057 (patch)
tree68e8f357f01495ee5cadab70584d662859610c1f
parent8f582c90de487c5a29cb61f41a715630cb143d45 (diff)
downloadrockbox-3957aa8720.tar.gz
rockbox-3957aa8720.zip
RFC BugFix tagtree.c reload data abort
TagNav.lua adds Reload to the Custom View menu of tagnav to allow users to make new search queries on the fly previously you had to reboot the device to do this I was getting a data abort prior to calling tagnav_init now but it worked fine if I copy pasted the contents of the init function I'm not sure how this fixed it but making a static init function makes it work as intended is it a race some weird thing with the compiler?? Ideas?? Change-Id: I7fd6c50f929d3ac2d9ecec5336942288e9213ad5
-rw-r--r--apps/tagtree.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 8e7b868dbc..7887ee1c36 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1248,7 +1248,7 @@ static void tagtree_unload(struct tree_context *c)
tree_unlock_cache(c);
}
-void tagtree_init(void)
+static bool initialize_tagtree(void) /* also used when user selects 'Reload' in 'custom view'*/
{
max_history_level = 0;
format_count = 0;
@@ -1269,7 +1269,7 @@ void tagtree_init(void)
if (!parse_menu(tagnavi_file))
{
tagtree_unload(NULL);
- return;
+ return false;
}
/* safety check since tree.c needs to cast tagentry to entry */
@@ -1286,6 +1286,12 @@ void tagtree_init(void)
add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event);
core_shrink(tagtree_handle, core_get_data(tagtree_handle), tagtree_buf_used);
+ return true;
+}
+
+void tagtree_init(void)
+{
+ initialize_tagtree();
}
static bool show_search_progress(bool init, int count)
@@ -1815,7 +1821,8 @@ int tagtree_load(struct tree_context* c)
{
splash(HZ, str(LANG_WAIT));
tagtree_unload(c);
- tagtree_init();
+ if (!initialize_tagtree())
+ return 0;
}
c->dirlevel = 0;
count = load_root(c);