mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pipewire: impl-module: respect PIPEWIRE_DLCLOSE
Commit b5c21c1fbc ("pipewire: use dlclose unless PIPEWIRE_DLCLOSE is set to false")
introduced the PIPEWIRE_DLCLOSE environmental variable to
force/prevent the dlclose()ing of shared objects. However,
native pipewire modules were not adjusted to respect its value,
and instead have been still using `pw_in_valgrind()` to
determine whether or not they should be unloaded.
Fix that by adding a private `pw_should_dlclose()` function
and using that in impl-module.c:pw_impl_module_destroy().
This commit is contained in:
parent
a3e86f1733
commit
3deaa2b0df
3 changed files with 10 additions and 2 deletions
|
|
@ -323,7 +323,7 @@ void pw_impl_module_destroy(struct pw_impl_module *module)
|
|||
pw_work_queue_cancel(pw_context_get_work_queue(module->context),
|
||||
module, SPA_ID_INVALID);
|
||||
|
||||
if (!pw_in_valgrind() && dlclose(impl->hnd) != 0)
|
||||
if (pw_should_dlclose() && dlclose(impl->hnd) != 0)
|
||||
pw_log_warn("%p: dlclose failed: %s", module, dlerror());
|
||||
free(impl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ unref_plugin(struct plugin *plugin)
|
|||
if (--plugin->ref == 0) {
|
||||
spa_list_remove(&plugin->link);
|
||||
pw_log_debug("unloaded plugin:'%s'", plugin->filename);
|
||||
if (global_support.do_dlclose)
|
||||
if (pw_should_dlclose())
|
||||
dlclose(plugin->hnd);
|
||||
free(plugin->filename);
|
||||
free(plugin);
|
||||
|
|
@ -791,6 +791,12 @@ bool pw_in_valgrind(void)
|
|||
return global_support.in_valgrind;
|
||||
}
|
||||
|
||||
bool
|
||||
pw_should_dlclose(void)
|
||||
{
|
||||
return global_support.do_dlclose;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
bool pw_check_option(const char *option, const char *value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1292,6 +1292,8 @@ void pw_settings_init(struct pw_context *context);
|
|||
int pw_settings_expose(struct pw_context *context);
|
||||
void pw_settings_clean(struct pw_context *context);
|
||||
|
||||
bool pw_should_dlclose(void);
|
||||
|
||||
/** \endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue