static GMainLoop *rm_client_loop = NULL;
static GMainContext *rm_client_context = NULL;
+static GThread *rm_thrd = NULL;
static void rm_add_main_loop(GMainLoop *loop)
{
if (main_loop != NULL)
g_main_loop_run(main_loop);
+ g_thread_join(rm_thrd);
+
RM_INFO("RM client thread finished");
return NULL;
}
GMainLoop *main_loop = g_main_loop_new(rm_client_ctx, FALSE);
rm_add_main_loop(main_loop);
- GThread *rm_thrd = g_thread_new("rm_client", rm_run_loop, NULL);
+ rm_thrd = g_thread_new("rm_client", rm_run_loop, NULL);
if (rm_thrd == NULL) {
// LCOV_EXCL_START
//GMainContext *context = g_main_context_new();
g_main_loop = g_main_loop_new(NULL, FALSE);
- GThread *cb_thread = g_thread_new("rc_cb_thread", tc_run_loop, g_main_loop);
+ g_autoptr(GThread) cb_thread = g_thread_new("rc_cb_thread", tc_run_loop, g_main_loop);
if (cb_thread == NULL) {
g_main_loop_unref(g_main_loop);