Skip to content

Commit

Permalink
sfos: loopback: Prevent crash when unloading module after sink_input …
Browse files Browse the repository at this point in the history
…move.
  • Loading branch information
jusa committed Feb 24, 2021
1 parent 7b861ff commit e20e99b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/module-loopback.c
Expand Up @@ -203,6 +203,13 @@ static void teardown(struct userdata *u) {
pa_assert(u);
pa_assert_ctl_context();

/* Set message handler to default handler. In case there was sink_input
* move just before the module was unloaded there would be one update to
* max request right before unloading the module. This would result in a
* call to adjust_rates somewhere after the struct userdata has been
* freed causing a segfault. */
u->sink_input->parent.process_msg = pa_sink_input_process_msg;

u->adjust_time = 0;
enable_adjust_timer(u, false);

Expand Down

0 comments on commit e20e99b

Please sign in to comment.