X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=2b99bbc993e8d9570b4b50744ec139f04926b4eb;hb=6a4e403927ffef4cae8726064dcf53c463eb128c;hp=aff833243ad968fbed03e27ffc32d52f3599bcad;hpb=3b05775dd0434b4501d4d681610d876fb923e908;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index aff833243..2b99bbc99 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -676,6 +676,9 @@ static void sessiond_cleanup(void) } } + DBG("Cleaning up all agent apps"); + agent_app_ht_clean(); + DBG("Closing all UST sockets"); ust_app_clean_list(); buffer_reg_destroy_registries(); @@ -5635,9 +5638,12 @@ int main(int argc, char **argv) goto exit_init_data; } - /* Initialize agent domain subsystem. */ - if (agent_setup()) { - /* ENOMEM at this point. */ + /* + * Initialize agent app hash table. We allocate the hash table here + * since cleanup() can get called after this point. + */ + if (agent_app_ht_alloc()) { + ERR("Failed to allocate Agent app hash table"); retval = -1; goto exit_init_data; }