From 06dbd430d41e964b1571906065cfe346e79f4f9e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Dec 2020 21:58:55 +0100 Subject: Avoid checking for null before deleting --- src/gtk2_in_qt5.cpp | 4 +--- src/x11_in_qt5.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gtk2_in_qt5.cpp b/src/gtk2_in_qt5.cpp index eacf677..daf4eac 100644 --- a/src/gtk2_in_qt5.cpp +++ b/src/gtk2_in_qt5.cpp @@ -74,9 +74,7 @@ wrapper_free(SuilWrapper* wrapper) gtk_widget_destroy(impl->plug); } - if (impl->host_widget) { - delete impl->host_widget; - } + delete impl->host_widget; free(impl); } diff --git a/src/x11_in_qt5.cpp b/src/x11_in_qt5.cpp index d5fd858..4b5d42d 100644 --- a/src/x11_in_qt5.cpp +++ b/src/x11_in_qt5.cpp @@ -145,9 +145,7 @@ wrapper_free(SuilWrapper* wrapper) { SuilX11InQt5Wrapper* impl = (SuilX11InQt5Wrapper*)wrapper->impl; - if (impl->host_widget) { - delete impl->host_widget; - } + delete impl->host_widget; free(impl); } -- cgit v1.2.1