diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-10-15 09:08:09 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2022-10-15 09:26:58 -0400 |
commit | 12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69 (patch) | |
tree | b4885951a5cba1b78c21b30ce37a1d6f1574aa5f /apps/plugin.c | |
parent | 9d3d925295112a0080bc1d70fad170db9e1af2a9 (diff) | |
download | rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.tar.gz rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.zip |
move buflib_free invalid handle check to the function
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free
Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
Diffstat (limited to 'apps/plugin.c')
-rw-r--r-- | apps/plugin.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 888a9e109c..4016040c5a 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -839,8 +839,7 @@ int plugin_load(const char* plugin, const void* parameter) | |||
839 | } | 839 | } |
840 | lc_close(current_plugin_handle); | 840 | lc_close(current_plugin_handle); |
841 | current_plugin_handle = pfn_tsr_exit = NULL; | 841 | current_plugin_handle = pfn_tsr_exit = NULL; |
842 | if (plugin_buffer_handle > 0) | 842 | plugin_buffer_handle = core_free(plugin_buffer_handle); |
843 | plugin_buffer_handle = core_free(plugin_buffer_handle); | ||
844 | } | 843 | } |
845 | 844 | ||
846 | splash(0, ID2P(LANG_WAIT)); | 845 | splash(0, ID2P(LANG_WAIT)); |
@@ -921,8 +920,7 @@ int plugin_load(const char* plugin, const void* parameter) | |||
921 | { /* close handle if plugin is no tsr one */ | 920 | { /* close handle if plugin is no tsr one */ |
922 | lc_close(current_plugin_handle); | 921 | lc_close(current_plugin_handle); |
923 | current_plugin_handle = NULL; | 922 | current_plugin_handle = NULL; |
924 | if (plugin_buffer_handle > 0) | 923 | plugin_buffer_handle = core_free(plugin_buffer_handle); |
925 | plugin_buffer_handle = core_free(plugin_buffer_handle); | ||
926 | } | 924 | } |
927 | 925 | ||
928 | talk_buffer_set_policy(TALK_BUFFER_DEFAULT); | 926 | talk_buffer_set_policy(TALK_BUFFER_DEFAULT); |