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; } }