summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-14 21:22:26 +0100
committerDavid Robillard <d@drobilla.net>2020-12-14 22:04:29 +0100
commit6d82745afdeff69ace846e0c10bf95b3362e1c03 (patch)
treeb66360dc8d7a54be45f6487dd93599adc65950c9
parentcba264d3555e2741665693da416f9649b8cc3a49 (diff)
downloadingen-6d82745afdeff69ace846e0c10bf95b3362e1c03.tar.gz
ingen-6d82745afdeff69ace846e0c10bf95b3362e1c03.tar.bz2
ingen-6d82745afdeff69ace846e0c10bf95b3362e1c03.zip
Don't check for null before deleting pointer
-rw-r--r--.clang-tidy1
-rw-r--r--src/gui/NodeModule.cpp9
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<const PortModel> model)
void
NodeModule::delete_port_view(std::shared_ptr<const PortModel> 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