From 0a610ee943be05bbe0627f3ed9d79625fb19197d Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 31 Jan 2022 18:27:04 +0300 Subject: [PATCH] Destroy the client after completing CLI command --- src/cli.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli.cpp b/src/cli.cpp index 3c0d3e19..010cbcc7 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -365,6 +365,13 @@ void cli_tool_t::run(json11::Json cfg) if (action_cb != NULL) ringloop->wait(); } + // Destroy the client + delete cli; + delete epmgr; + delete ringloop; + cli = NULL; + epmgr = NULL; + ringloop = NULL; } int main(int narg, const char *args[]) @@ -374,5 +381,6 @@ int main(int narg, const char *args[]) exe_name = args[0]; cli_tool_t *p = new cli_tool_t(); p->run(cli_tool_t::parse_args(narg, args)); + delete p; return 0; }