summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-04-03 18:56:21 +0200
committerDavid Henningsson <david.henningsson@canonical.com>2012-04-04 09:04:12 +0200
commite815a1f81a5a018f8d7c8f6be7f93e600606ed24 (patch)
tree693e52e6c147b92d9f14bf814138488ba74650f2
parentb762f4eef10fd90c4e85e574b4fcf9429ce1cbe3 (diff)
module-loopback: Reset process_msg callbacks in teardown
Make sure we can't be called into by remaining references to sink-inputs and source-outputs after we have unloaded, as that will likely lead to segfaults. Thanks to Tanu for providing valuable input on this patch. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r--src/modules/module-loopback.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 0d65682c..1a69445f 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -152,11 +152,13 @@ static void teardown(struct userdata *u) {
pa_source_output_unlink(u->source_output);
if (u->sink_input) {
+ u->sink_input->parent.process_msg = pa_sink_input_process_msg;
pa_sink_input_unref(u->sink_input);
u->sink_input = NULL;
}
if (u->source_output) {
+ u->source_output->parent.process_msg = pa_source_output_process_msg;
pa_source_output_unref(u->source_output);
u->source_output = NULL;
}