From 8e1fed20fa5522cbb9ca1b5862867a02169ce01c Mon Sep 17 00:00:00 2001 From: Gregory Ling <17791817+glingy@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:24:49 -0500 Subject: [PATCH] Move deletion of topicTree to after use of the pointer in removePre/PostHandler This fails clang-tidy and is probably a reasonable thing to change --- src/App.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.h b/src/App.h index d0cac7f42..c16798e95 100644 --- a/src/App.h +++ b/src/App.h @@ -189,12 +189,12 @@ struct TemplatedApp { /* Delete TopicTree */ if (topicTree) { - delete topicTree; - /* And unregister loop callbacks */ /* We must unregister any loop post handler here */ Loop::get()->removePostHandler(topicTree); Loop::get()->removePreHandler(topicTree); + + delete topicTree; } }