From 248ea1b8a95d8ba082cfc322a31016a7449f46b1 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 20 Apr 2021 14:28:44 +0100 Subject: [PATCH] Fix a crash when shutting down the daemon Unloading the GModule means that any GTypes registered by that plugin cannot be queried. Other plugins could unintentionally call methods like G_OBJECT_TYPE_NAME() which makes the daemon explode. There's no need to actually close the module, and so we're just making life diffult for ourselves for no good reason. Fixes the other half of https://github.com/fwupd/fwupd/issues/3156 --- libfwupdplugin/fu-plugin.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/libfwupdplugin/fu-plugin.c b/libfwupdplugin/fu-plugin.c index ca7b55829..539f8ea08 100644 --- a/libfwupdplugin/fu-plugin.c +++ b/libfwupdplugin/fu-plugin.c @@ -13,9 +13,6 @@ #include #include #include -#ifdef HAVE_VALGRIND -#include -#endif /* HAVE_VALGRIND */ #include "fu-context-private.h" #include "fu-device-private.h" @@ -2328,14 +2325,6 @@ fu_plugin_finalize (GObject *object) g_array_unref (priv->device_gtypes); g_free (priv->build_hash); g_free (priv->data); - /* Must happen as the last step to avoid prematurely - * freeing memory held by the plugin */ -#ifdef RUNNING_ON_VALGRIND - if (priv->module != NULL && RUNNING_ON_VALGRIND == 0) -#else - if (priv->module != NULL) -#endif - g_module_close (priv->module); G_OBJECT_CLASS (fu_plugin_parent_class)->finalize (object); }