summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/module.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-29 16:25:29 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-29 16:25:29 +0100
commit746dc2ac19950d4eecc083929d6ed86443e3a112 (patch)
tree558d6fa8052ca28f3f6af7d8ccf7b5fbca7a7570 /src/pulsecore/module.c
parent4a06af6081c0fc081ad6ca136880a61ebe1c4e01 (diff)
get rid of nonsensical late initialization of namereg/scache and things
Diffstat (limited to 'src/pulsecore/module.c')
-rw-r--r--src/pulsecore/module.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index d470bb0b..1eb70c8e 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -75,7 +75,7 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
m->load_once = load_once();
- if (m->load_once && c->modules) {
+ if (m->load_once) {
pa_module *i;
uint32_t idx;
/* OK, the module only wants to be loaded once, let's make sure it is */
@@ -105,9 +105,6 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
goto fail;
}
- if (!c->modules)
- c->modules = pa_idxset_new(NULL, NULL);
-
pa_assert_se(pa_idxset_put(c->modules, m, &m->index) >= 0);
pa_assert(m->index != PA_IDXSET_INVALID);
@@ -200,17 +197,11 @@ void pa_module_unload_by_index(pa_core *c, uint32_t idx, pa_bool_t force) {
}
void pa_module_unload_all(pa_core *c) {
+ pa_module *m;
pa_assert(c);
- if (c->modules) {
- pa_module *m;
-
- while ((m = pa_idxset_steal_first(c->modules, NULL)))
- pa_module_free(m);
-
- pa_idxset_free(c->modules, NULL, NULL);
- c->modules = NULL;
- }
+ while ((m = pa_idxset_steal_first(c->modules, NULL)))
+ pa_module_free(m);
if (c->module_defer_unload_event) {
c->mainloop->defer_free(c->module_defer_unload_event);
@@ -226,9 +217,6 @@ static void defer_cb(pa_mainloop_api*api, pa_defer_event *e, void *userdata) {
pa_core_assert_ref(c);
api->defer_enable(e, 0);
- if (!c->modules)
- return;
-
while ((m = pa_idxset_iterate(c->modules, &state, NULL)))
if (m->unload_requested)
pa_module_unload(c, m, TRUE);