[pulseaudio-commits] 3 commits - configure.ac src/pulsecore
David Henningsson
diwic at kemper.freedesktop.org
Mon Sep 7 06:00:39 PDT 2015
configure.ac | 2 +-
src/pulsecore/core-util.c | 7 ++++---
src/pulsecore/module.c | 5 +++--
3 files changed, 8 insertions(+), 6 deletions(-)
New commits:
commit a527711528ce8f9e1b1f73957fa8281f9126b370
Author: David Henningsson <david.henningsson at canonical.com>
Date: Thu Sep 3 09:43:01 2015 +0200
module: Always remove freed module from modules_pending_unload
pa_module_free is called from more than one place, not all of
these places correctly removed the module from the
modules_pending_unload array, potentially causing a dangling pointer
in that array.
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index 1d4187e..2dd64b5 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -248,6 +248,8 @@ static void pa_module_free(pa_module *m) {
lt_dlclose(m->dl);
+ pa_hashmap_remove(m->core->modules_pending_unload, m);
+
pa_log_info("Unloaded \"%s\" (index: #%u).", m->name, m->index);
pa_subscription_post(m->core, PA_SUBSCRIPTION_EVENT_MODULE|PA_SUBSCRIPTION_EVENT_REMOVE, m->index);
@@ -264,8 +266,6 @@ void pa_module_unload(pa_core *c, pa_module *m, bool force) {
if (m->core->disallow_module_loading && !force)
return;
- pa_hashmap_remove(c->modules_pending_unload, m);
-
if (!(m = pa_idxset_remove_by_data(c->modules, m, NULL)))
return;
@@ -323,6 +323,7 @@ void pa_module_unload_all(pa_core *c) {
c->mainloop->defer_free(c->module_defer_unload_event);
c->module_defer_unload_event = NULL;
}
+ pa_assert(pa_hashmap_isempty(c->modules_pending_unload));
}
static void defer_cb(pa_mainloop_api*api, pa_defer_event *e, void *userdata) {
commit 83de5a0995f0f98217965dab78ffb02eb50fc0e7
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Wed May 20 22:35:28 2015 +0300
core-util: include xlocale.h when using strtod_l()
Based on some googling, strtod_l() is defined in xlocale.h on BSD.
Glibc seems to define it in stdlib.h, but only if GNU extensions are
enabled (otherwise the function won't be available). So, this patch
should fix the use of strtod_l() on BSDs, but on other systems things
may or may not be still broken.
The original patch author is Jakob Fink <jfink at gmx.at>. He sent this
patch to the freebsd-gnome mailing list:
http://lists.freebsd.org/pipermail/freebsd-gnome/2015-April/032138.html
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90285
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 824368a..ba31221 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -54,6 +54,7 @@
#ifdef HAVE_STRTOD_L
#include <locale.h>
+#include <xlocale.h>
#endif
#ifdef HAVE_SCHED_H
commit 27d71c00d8d8bf07b5109dc016d53c7d8c3a1975
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Wed May 20 22:35:27 2015 +0300
build-sys: check strtod_l instead of strtof_l
We have no strtof_l calls in the code, so it doesn't make sense to
check that function's availability. We have one strtod_l call, so
let's check that instead.
I don't know if this change makes any practical difference. I just
wondered why we had HAVE_STRTOF_L ifdefs in core-util.c for code that
didn't use strtof_l.
diff --git a/configure.ac b/configure.ac
index 12512fc..093e8d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -572,7 +572,7 @@ AC_CHECK_FUNCS_ONCE([strerror_r])
AC_CHECK_FUNCS_ONCE([lstat])
# Non-standard
-AC_CHECK_FUNCS_ONCE([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtof_l pipe2 accept4])
+AC_CHECK_FUNCS_ONCE([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtod_l pipe2 accept4])
AC_FUNC_ALLOCA
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index ad5b2d2..824368a 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -52,7 +52,7 @@
#include <pcreposix.h>
#endif
-#ifdef HAVE_STRTOF_L
+#ifdef HAVE_STRTOD_L
#include <locale.h>
#endif
@@ -2401,7 +2401,7 @@ int pa_atol(const char *s, long *ret_l) {
return 0;
}
-#ifdef HAVE_STRTOF_L
+#ifdef HAVE_STRTOD_L
static locale_t c_locale = NULL;
static void c_locale_destroy(void) {
@@ -2431,7 +2431,7 @@ int pa_atod(const char *s, double *ret_d) {
/* This should be locale independent */
-#ifdef HAVE_STRTOF_L
+#ifdef HAVE_STRTOD_L
PA_ONCE_BEGIN {
More information about the pulseaudio-commits
mailing list