Fix: clean-up agent app hash table from the main sessiond thread
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index aff833243ad968fbed03e27ffc32d52f3599bcad..2b99bbc993e8d9570b4b50744ec139f04926b4eb 100644 (file)
@@ -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;
        }
This page took 0.024808 seconds and 4 git commands to generate.