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
This commit is contained in:
William Wilgus 2022-10-15 09:08:09 -04:00 committed by William Wilgus
parent 9d3d925295
commit 12ef045fdf
18 changed files with 32 additions and 62 deletions

View file

@ -839,8 +839,7 @@ int plugin_load(const char* plugin, const void* parameter)
}
lc_close(current_plugin_handle);
current_plugin_handle = pfn_tsr_exit = NULL;
if (plugin_buffer_handle > 0)
plugin_buffer_handle = core_free(plugin_buffer_handle);
plugin_buffer_handle = core_free(plugin_buffer_handle);
}
splash(0, ID2P(LANG_WAIT));
@ -921,8 +920,7 @@ int plugin_load(const char* plugin, const void* parameter)
{ /* close handle if plugin is no tsr one */
lc_close(current_plugin_handle);
current_plugin_handle = NULL;
if (plugin_buffer_handle > 0)
plugin_buffer_handle = core_free(plugin_buffer_handle);
plugin_buffer_handle = core_free(plugin_buffer_handle);
}
talk_buffer_set_policy(TALK_BUFFER_DEFAULT);