From 6d82745afdeff69ace846e0c10bf95b3362e1c03 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 14 Dec 2020 21:22:26 +0100 Subject: Don't check for null before deleting pointer --- .clang-tidy | 1 - src/gui/NodeModule.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index fab3069e..8f602116 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -64,7 +64,6 @@ Checks: > -performance-unnecessary-value-param, -portability-simd-intrinsics, -readability-convert-member-functions-to-static, - -readability-delete-null-pointer, -readability-implicit-bool-conversion, -readability-use-anyofallof, WarningsAsErrors: '*' diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index b90a7056..e09a3479 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -336,13 +336,14 @@ NodeModule::port(std::shared_ptr model) void NodeModule::delete_port_view(std::shared_ptr model) { - Port* p = port(model); - if (p) { - delete p; - } else { + Port* const p = port(model); + + if (!p) { app().log().warn("Failed to find port %1% on module %2%\n", model->path(), _block->path()); } + + delete p; } bool -- cgit v1.2.1