summaryrefslogtreecommitdiff
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-3957aa87205e8263384f7b50ed18c1df0de0b057.tar.gz
rockbox-3957aa87205e8263384f7b50ed18c1df0de0b057.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)
1248 tree_unlock_cache(c); 1248 tree_unlock_cache(c);
1249} 1249}
1250 1250
1251void tagtree_init(void) 1251static bool initialize_tagtree(void) /* also used when user selects 'Reload' in 'custom view'*/
1252{ 1252{
1253 max_history_level = 0; 1253 max_history_level = 0;
1254 format_count = 0; 1254 format_count = 0;
@@ -1269,7 +1269,7 @@ void tagtree_init(void)
1269 if (!parse_menu(tagnavi_file)) 1269 if (!parse_menu(tagnavi_file))
1270 { 1270 {
1271 tagtree_unload(NULL); 1271 tagtree_unload(NULL);
1272 return; 1272 return false;
1273 } 1273 }
1274 1274
1275 /* safety check since tree.c needs to cast tagentry to entry */ 1275 /* safety check since tree.c needs to cast tagentry to entry */
@@ -1286,6 +1286,12 @@ void tagtree_init(void)
1286 add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event); 1286 add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event);
1287 1287
1288 core_shrink(tagtree_handle, core_get_data(tagtree_handle), tagtree_buf_used); 1288 core_shrink(tagtree_handle, core_get_data(tagtree_handle), tagtree_buf_used);
1289 return true;
1290}
1291
1292void tagtree_init(void)
1293{
1294 initialize_tagtree();
1289} 1295}
1290 1296
1291static bool show_search_progress(bool init, int count) 1297static bool show_search_progress(bool init, int count)
@@ -1815,7 +1821,8 @@ int tagtree_load(struct tree_context* c)
1815 { 1821 {
1816 splash(HZ, str(LANG_WAIT)); 1822 splash(HZ, str(LANG_WAIT));
1817 tagtree_unload(c); 1823 tagtree_unload(c);
1818 tagtree_init(); 1824 if (!initialize_tagtree())
1825 return 0;
1819 } 1826 }
1820 c->dirlevel = 0; 1827 c->dirlevel = 0;
1821 count = load_root(c); 1828 count = load_root(c);