From 3e64fdfb0fd5ab42a2ea7cd5ad1bf335dbbcffd6 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 25 Jan 2021 18:11:50 +0200 Subject: [PATCH] threads: avoid assert The assert failure was spotted in the wild... we need to investigate, but we can ignore it now to avoid SIGABRT. --- lib/mu-query-threads.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/mu-query-threads.cc b/lib/mu-query-threads.cc index 87a4497f..884d0e13 100644 --- a/lib/mu-query-threads.cc +++ b/lib/mu-query-threads.cc @@ -292,8 +292,13 @@ prune_empty_containers (Container& container) if (container.children.empty()) { // If it is an empty container with no children, nuke it. - if (container.parent) - container.parent->remove_child(container); + if (container.parent) { + if (!container.parent->has_child(container)) { + container.parent = {}; + g_warning ("unexpected parent->child relation"); + } else + container.parent->remove_child(container); + } container.is_nuked = true; return; }