Skip to content

Commit

Permalink
Move plugin_rpc_err cleanup to plugin cleanup code
Browse files Browse the repository at this point in the history
That way a new external API is no longer required.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Jan 28, 2025
1 parent d598866 commit 653f259
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions apps/backend/backend_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ backend_terminate(clixon_handle h)
/* Delete all plugins, RPC callbacks, and upgrade callbacks */
clixon_plugin_module_exit(h);
/* Delete all process-control entries */
clixon_process_delete_all(h);
/* Free memory associated with plugin_rpc_err() */
clixon_plugin_rpc_err_exit(h);
clixon_process_delete_all(h);

xpath_optimize_exit();
clixon_pagination_free(h);
Expand Down
1 change: 0 additions & 1 deletion lib/clixon/clixon_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ int clixon_plugin_module_exit(clixon_handle h);
int clixon_plugin_rpc_err(clixon_handle h, const char *ns,
const char *type, const char *tag, const char *info,
const char *severity, const char *fmt, ...);
void clixon_plugin_rpc_err_exit(clixon_handle h);
int clixon_plugin_rpc_err_set(clixon_handle h);
int clixon_plugin_report_err(clixon_handle h, cbuf *cbret);
int clixon_plugin_report_err_xml(clixon_handle h, cxobj **xreg, char *err, ...);
Expand Down
4 changes: 3 additions & 1 deletion lib/src/clixon_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@ clixon_plugin_rpc_err(clixon_handle h,
*
* @param[in] h Clixon
*/
void
static void
clixon_plugin_rpc_err_exit(clixon_handle h)
{
cvec *cvv = clicon_data_cvec_get(h, "rpc_err");
Expand Down Expand Up @@ -2021,5 +2021,7 @@ clixon_plugin_module_exit(clixon_handle h)
free(ph);
plugin_module_struct_set(h, NULL);
}
/* Free memory associated with plugin_rpc_err() */
clixon_plugin_rpc_err_exit(h);
return 0;
}

0 comments on commit 653f259

Please sign in to comment.