From 372981920e820fc24cf059102809abc97b52b6d5 Mon Sep 17 00:00:00 2001 From: "@xAndy" Date: Fri, 26 Feb 2021 12:49:33 +0100 Subject: [PATCH] Don't dlclose nullptrs in plugins (#179) * dont dlclose nullptrs in plugins this fixes a segmentation fault at startup when dlclose is called with a nullptr * Style fixes Co-authored-by: WerWolv --- source/helpers/plugin_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/helpers/plugin_handler.cpp b/source/helpers/plugin_handler.cpp index 7be860c0a..5f2559bd9 100644 --- a/source/helpers/plugin_handler.cpp +++ b/source/helpers/plugin_handler.cpp @@ -41,7 +41,8 @@ namespace hex { } Plugin::~Plugin() { - dlclose(this->m_handle); + if (this->m_handle != nullptr) + dlclose(this->m_handle); } void Plugin::initializePlugin() const {